Documentation ¶
Index ¶
- Constants
- func AesDecrypt(crypted, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func BanerwaiAPIV1CheckSign(sign, apiKey string, args ...string) bool
- func BanerwaiAPIV1GenSign(apiKey string, args ...string) string
- func Base64Decode(dec []byte) ([]byte, error)
- func Base64Encode(src []byte) []byte
- func CompareDoubleMd5(source, md5 string) bool
- func CompareHS256Hex(in, secret, hs256Hex string) bool
- func CompareHS512Hex(in, secret, hs512Hex string) bool
- func CompareHash(digest []byte, password string) bool
- func CompareMd5(source, md5 string) bool
- func CompareSHA256Hex(in, sha256Hex string) bool
- func CompareSHA512Hex(in, sha512Hex string) bool
- func DecodeBase64(dec string) (string, error)
- func DecryptAes(crypted, key []byte) ([]byte, error)
- func DecryptAesString(crypted, key string) (string, error)
- func DesDecrypt(crypted, key []byte) ([]byte, error)
- func DesEncrypt(origData, key []byte) ([]byte, error)
- func DoubleMd5(source string) string
- func EncodeBase64(src string) string
- func EncryptAes(origData, key []byte) ([]byte, error)
- func EncryptAesString(origData, key string) (string, error)
- func GenerateHash(password string) ([]byte, error)
- func GetRandomItNum(num int) int
- func GetRandomString(num int) string
- func HS256Base64(in, secret string) string
- func HS256Byte(in, secret []byte) []byte
- func HS256Hex(in, secret string) string
- func HS512Base64(in, secret string) string
- func HS512Byte(in, secret []byte) []byte
- func HS512Hex(in, secret string) string
- func Krand(size int, kind int) string
- func Md5(source string) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func RandomPwd(num int) string
- func SHA256Base64(in string) string
- func SHA256Byte(in []byte) []byte
- func SHA256Hex(in string) string
- func SHA512Base64(in string) string
- func SHA512Byte(in []byte) []byte
- func SHA512Hex(in string) string
- func TripleDesDecrypt(crypted, key []byte) ([]byte, error)
- func TripleDesEncrypt(origData, key []byte) ([]byte, error)
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
Constants ¶
const ( // KcRandKindNum 纯数字 KcRandKindNum = 0 // KcRandKindLower 小写字母 KcRandKindLower = 1 // KcRandKindUpper 大写字母 KcRandKindUpper = 2 // KcRandKindAll 数字、大小写字母 KcRandKindAll = 3 )
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
AesDecrypt decrypt aes 2 []byte
func AesEncrypt ¶
AesEncrypt encrypt aes 2 []byte
func BanerwaiAPIV1CheckSign ¶
BanerwaiAPIV1CheckSign banerwai api sign check
func BanerwaiAPIV1GenSign ¶
BanerwaiAPIV1GenSign banerwai api gen sign
func Base64Decode ¶
Base64Decode base64 decode 2 []byte
func CompareDoubleMd5 ¶
CompareDoubleMd5 compare double md5 value
func CompareHS256Hex ¶
CompareHS256Hex compare HS256Hex value
func CompareHS512Hex ¶
CompareHS512Hex compare HS512Hex value
func CompareHash ¶
CompareHash compares bcrypt password with a plaintext one. Returns true if passwords match and false if they do not.
func CompareSHA256Hex ¶
CompareSHA256Hex compare sha256 value
func CompareSHA512Hex ¶
CompareSHA512Hex compare sha512 value
func DecodeBase64 ¶
DecodeBase64 base64 decode 2 string
func DecryptAesString ¶
DecryptAesString decrypt aes 2 string
func DesDecrypt ¶
DesDecrypt des decrypt 2 []byte
func DesEncrypt ¶
DesEncrypt des encrypt 2 []byte
func EncryptAesString ¶
EncryptAesString encrypt aes 2 string
func GenerateHash ¶
GenerateHash generates bcrypt hash from plaintext password
func GetRandomItNum ¶
GetRandomItNum 返回输入参数以下的随机数字,如输入参数为5,随机返回0,1,2,3,4
func HS256Base64 ¶
HS256Base64 hs256 in string/out base64
func HS512Base64 ¶
HS512Base64 hs512 in string/out base64
func PKCS5Padding ¶
PKCS5Padding des PKCS5Padding
func TripleDesDecrypt ¶
TripleDesDecrypt 3DES解密
func TripleDesEncrypt ¶
TripleDesEncrypt 3DES加密
func ZeroPadding ¶
ZeroPadding des zeropadding
Types ¶
This section is empty.