Documentation
¶
Index ¶
- Variables
- func AesDeCryptCBC(cypted []byte, key []byte) ([]byte, error)
- func AesDecryptGCM(cipherText []byte, key []byte) ([]byte, error)
- func AesEncryptCBC(origData []byte, key []byte) ([]byte, error)
- func AesEncryptGCM(plainText []byte, key []byte) ([]byte, error)
- func Base64DecodeString(content string) ([]byte, error)
- func Base64EncodeToString(content []byte) string
- func CalculateFileXxHash(filePath string) (uint64, int64, error)
- func CompareBcryptPasswd(password, storedHash string) bool
- func DePwdCodeUseKey(pwd string, pwdKey []byte) ([]byte, error)
- func EnPwdCodeUseKey(pwd []byte, pwdKey []byte) (string, error)
- func GenerateAESKey(num int) ([]byte, error)
- func GetMd5FromFile(path string) (string, error)
- func GetMd5FromString(data string) string
- func GetMd5FromString2(passwd string) string
- func GetPasswdWithBcrypt(password string) (string, error)
- func GetSHA256FromFile(path string) (string, error)
- func GetSHA256FromString(data string) string
- func GetStrSha256(s string) string
- func GetStrSha512(s string) string
- func SliceItemSwap(s []byte, i, j int)
Constants ¶
This section is empty.
Variables ¶
View Source
var PwdKey = []byte("[email protected]")
Functions ¶
func Base64DecodeString ¶
func Base64EncodeToString ¶
func CalculateFileXxHash ¶
CalculateFileHash 计算文件的 xxhash 哈希值
func CompareBcryptPasswd ¶
CompareBcryptPasswd 验证bcrypt加密的密码
func EnPwdCodeUseKey ¶
加密base64(使用自定义Key)
func GenerateAESKey ¶
长度32字节(256比特)的切片长度 对应AES-256,密钥16字节对用AES-128,密钥24字节对用AES-192,
func GetMd5FromString2 ¶
func GetPasswdWithBcrypt ¶
GetPasswdWithBcrypt 得到由bcrypt加密的密码
func GetStrSha256 ¶
1、GetStrSha256(s string) string 得到字符串的sha256 2、GetStrSha512(s string) string 得到字符串的sha512
func GetStrSha512 ¶
func SliceItemSwap ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.