Documentation ¶
Index ¶
- Variables
- func BytesCombine(pBytes ...[]byte) []byte
- func BytesCompare(bytesA, bytesB []byte) bool
- func BytesPKCS5Padding(cipherData []byte, blockSize int) []byte
- func BytesPKCS5UnPadding(originalData []byte) ([]byte, error)
- func BytesPad(pBytes []byte, length int) []byte
- func ChangePrivCurveToS256k1(key *ecdsa.PrivateKey) *ecdsa.PrivateKey
- func StringInSlice(a string, list []string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 密码错误,解密失败 ErrPwWrong = errors.New("password is wrong") )
Functions ¶
func BytesCompare ¶
BytesCompare compares two byte arrays, give the result whether they are the same or not
func BytesPKCS5Padding ¶
PKCS7Padding:缺N个字节就补N个字节的0, PKCS5Padding:缺N个字节就补充N个字节的N,例如缺8个字节,就补充8个字节的数字8
func BytesPKCS5UnPadding ¶
PKCS7Padding:缺N个字节就补N个字节的0, PKCS5Padding:缺N个字节就补充N个字节的N,例如缺8个字节,就补充8个字节的数字8 PKCS5UnPadding:获取最后一个字节,转换为数字N,然后剔除掉最后N个字节,例如最后一个字节是数字8,就剔除掉最后8个字节
func ChangePrivCurveToS256k1 ¶
func ChangePrivCurveToS256k1(key *ecdsa.PrivateKey) *ecdsa.PrivateKey
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.