Documentation ¶
Index ¶
- Constants
- func AESCBCDecrypt(cipherData, key, iv []byte) ([]byte, error)
- func AESCBCEncrypt(rawData, key, iv []byte) ([]byte, error)
- func AESECBDecrypt(buf, key []byte) ([]byte, error)
- func AESECBEncrypt(data, key []byte) ([]byte, error)
- func Base59Decoding(strByte []byte, key ...string) []byte
- func Base59Encoding(strByte []byte, key ...string) string
- func Base64Decode(str string) []byte
- func Base64Encode(buf []byte) string
- func CalculateFileMD5(filePath string) (string, error)
- func CreateHash(data []byte, hashingAlgorithm string, encoding string) (string, error)
- func GenerateAESKey() (string, error)
- func GenerateAESKeyAndIV() (string, string, error)
- func HMacMd5(buf, key []byte) string
- func HMacSha1(buf, key []byte) string
- func HMacSha256(buf, key []byte) string
- func MD5(buf []byte) string
- func Md5(buf []byte) string
- func SHA1(buf []byte) string
- func SHA256(buf, key []byte) string
- func SHAWithRSA(key, data []byte) (string, error)
- func SessionId() string
- func UrlDecode(str string) string
- func UrlEncode(str string) string
Constants ¶
View Source
const ( HashingAlgorithmMd5 = "md5" HashingAlgorithmSha1 = "sha1" HashingAlgorithmSha256 = "sha256" HashingAlgorithmSha512 = "sha512" )
View Source
const ( EncodingHex = "hex" EncodingBase64 = "base64" )
Variables ¶
This section is empty.
Functions ¶
func AESCBCDecrypt ¶
func AESCBCEncrypt ¶
func AESECBDecrypt ¶
func AESECBEncrypt ¶
func Base59Decoding ¶
func Base59Encoding ¶
如果遇到特殊字符,需要用 url.PathEscape(str) 解决
func Base64Decode ¶
func Base64Encode ¶
func CreateHash ¶
CreateHash 计算文件的哈希值 data: 输入数据 hashingAlgorithm: 哈希算法名称 ("md5", "sha1", "sha256", "sha512" 等) encoding: 编码方式 ("hex" 或 "base64")
func HMacSha256 ¶
func SHAWithRSA ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.