Documentation
¶
Index ¶
- func AESDecrypt(decodeStr string, key string) (string, error)
- func AESEncrypt(plainText string, key string) string
- func AesDecryptECB(encrypted []byte, key []byte) (decrypted []byte)
- func AppletDecrypt(sessionKey, encryptedData string, iv string) ([]byte, error)
- func Decrypt(data []byte, key []byte) []byte
- func Encrypt(data []byte, key []byte) []byte
- func GetUUID() (string, error)
- func GobDecode(data []byte, to interface{}) error
- func GobEncode(data interface{}) ([]byte, error)
- func IntDateTime(val int64) (ret string)
- func IntDateTimeFormat(val int64, format string) (ret string)
- func MD5(str string) string
- func PKCS5Padding(cipherText []byte, blockSize int, after int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PKCS7UnPadding(plantText []byte) []byte
- func TimeFormat(t time.Time, format string) string
- type MemoryCache
- type XXTea
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecrypt ¶
AESDecrypt AES CBC decrypt
func AesDecryptECB ¶ added in v1.0.8
AesDecryptECB AES-256-ECB decrypt
func AppletDecrypt ¶ added in v1.0.8
AppletDecrypt 解密小程序敏感信息
func Decrypt ¶
Decrypt the data with key. data is the bytes to be decrypted. key is the decrypted key. It is the same as the encrypt key.
func Encrypt ¶
Encrypt the data with key. data is the bytes to be encrypted. key is the encrypt key. It is the same as the decrypt key.
func IntDateTime ¶
IntDateTime returns int64 time to format
func IntDateTimeFormat ¶
IntDateTimeFormat DateTimeFormat
func PKCS5Padding ¶
PKCS5Padding PKCS5Padding
func PKCS7UnPadding ¶ added in v1.0.8
PKCS7UnPadding return unpadding []Byte plantText
Types ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache memory cache struct
func NewMemoryCache ¶
func NewMemoryCache(defaultHour, cleanupInterval int) *MemoryCache
NewMemoryCache return a new memory cache
func (*MemoryCache) GetCache ¶
func (m *MemoryCache) GetCache(key string, to interface{}) (ok bool, err error)
GetCache return cache data
func (*MemoryCache) RemoveCache ¶
func (m *MemoryCache) RemoveCache(key string) error
RemoveCache delete cache
func (*MemoryCache) SetCache ¶
func (m *MemoryCache) SetCache(key string, value interface{}) error
SetCache set cache to key and return error
type XXTea ¶
type XXTea struct {
Key string
}
func (*XXTea) DecryptString ¶
DecryptString returns decrypt string and error
func (*XXTea) EncryptString ¶
EncryptString returns encrypt string