convertor

package
v0.0.0-...-520d599 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TranslateMap = map[string]Convertor{
	"plaintext": &Plaintext{},
	"replace":   &Replace{},
}

Functions

This section is empty.

Types

type Convertor

type Convertor interface {
	Init()
	// Encrypt 加密方法
	Encrypt(st []byte) []byte
	// Decrypt 解密方法
	Decrypt(st []byte) []byte
	// GenNewPW 生成新密码
	GenNewPW(newPW []byte)
	// GetPW 获取密码
	GetPW() []byte
}

func GetNewConvertor

func GetNewConvertor(mode string) (Convertor, error)

type Plaintext

type Plaintext struct {
	// contains filtered or unexported fields
}

func (*Plaintext) Decrypt

func (re *Plaintext) Decrypt(st []byte) []byte

func (*Plaintext) Encrypt

func (re *Plaintext) Encrypt(st []byte) []byte

func (*Plaintext) GenNewPW

func (re *Plaintext) GenNewPW(newPW []byte)

func (*Plaintext) GetPW

func (re *Plaintext) GetPW() []byte

func (*Plaintext) Init

func (re *Plaintext) Init()

type Replace

type Replace struct {
	// contains filtered or unexported fields
}

func (*Replace) Decrypt

func (re *Replace) Decrypt(st []byte) []byte

func (*Replace) Encrypt

func (re *Replace) Encrypt(st []byte) []byte

func (*Replace) GenNewPW

func (re *Replace) GenNewPW(newPW []byte)

func (*Replace) GetPW

func (re *Replace) GetPW() []byte

func (*Replace) Init

func (re *Replace) Init()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL