Documentation ¶
Index ¶
- Constants
- Variables
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func Float64StrToBytes(num float64) []byte
- func GetRandomKeyIndex() int32
- func Int64StrToBytes(num int64) []byte
- func PKCS5Padding(plaintext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func StringToBytes(str string) []byte
- type AesController
- type Data
- func (data *Data) CheckNil() bool
- func (data *Data) DecryptBytes(cipherStr string) ([]byte, error)
- func (data *Data) DecryptFloat64(cipherStr string) (float64, error)
- func (data *Data) DecryptInt64(cipherStr string) (int64, error)
- func (data *Data) DecryptString(cipherStr string) (string, error)
- func (data *Data) Encrypt(plainData interface{}) (string, error)
Constants ¶
View Source
const ( StringData = 1 Int64Data = 2 BytesData = 3 Float64Data = 4 )
View Source
const SumKey = 1
View Source
const VersionLen = 5
Variables ¶
View Source
var AesKeys []string
View Source
var Version = []byte("1.0.0")
Functions ¶
func Float64StrToBytes ¶
func GetRandomKeyIndex ¶
func GetRandomKeyIndex() int32
func Int64StrToBytes ¶
func StringToBytes ¶
Types ¶
type AesController ¶
Click to show internal directories.
Click to hide internal directories.