Versions in this module Expand all Collapse all v1 v1.0.1 Feb 22, 2022 v1.0.0 Jan 18, 2022 Changes in this version + var CapitalCharList = make([]uint64, 26) + var CapitalCharMap = make(map[byte]uint64) + var LowercaseCharList = make([]uint64, 26) + var LowercaseCharMap = make(map[byte]uint64) + var NumberCharList = make([]uint64, 10) + var NumberCharMap = make(map[byte]uint64) + var SpecialCharList = make([]uint64, 128) + var SpecialCharMap = make(map[byte]uint64) + var VisualCharAll = 0 + var VisualCharCapital = 2 + var VisualCharList = make([]uint64, 256) + var VisualCharLowercase = 3 + var VisualCharNumber = 1 + var VisualCharSpecial = 4 + func Base64Decode(data string) ([]byte, error) + func Base64DecodeURL(data string) ([]byte, error) + func Base64Encode(data []byte) string + func Base64EncodeURL(data []byte) string + func CRC32Cp(data []byte) uint32 + func CRC32IEEE(data []byte) uint32 + func CRC32Kp(data []byte) uint32 + func CRC64ECMA(data []byte) uint64 + func CRC64ISO(data []byte) uint64 + func EncodePrivateKeyBufferRSA(priKey *rsa.PrivateKey) []byte + func EncodePrivateKeyFileRSA(priKey *rsa.PrivateKey, fileName string) error + func EncodePublicKeyBufferRSA(pubKey *rsa.PublicKey) ([]byte, error) + func EncodePublicKeyFileRSA(pubKey *rsa.PublicKey, fileName string) error + func GenerateKeyRSA(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error) + func GetCertBytes(cert *pem.Block, key *pem.Block) ([]byte, []byte) + func GetHmacSha256Hex(key string, data []byte) string + func IsAccountEn(str string) (bool, error) + func IsAccountZh(str string) (bool, error) + func IsEmail(str string) (bool, error) + func IsIPPort(str string) (bool, error) + func IsIPv4(str string) (bool, error) + func IsPhone(str string) (bool, error) + func IssueCertImpl(rootCa *x509.Certificate, rootKey *rsa.PrivateKey) (*pem.Block, *pem.Block, error) + func LoadPublicKeyRSA(pubKey []byte) (*rsa.PublicKey, error) + func LoadRSAPrivateKeyPKCS1(priKey []byte) (*rsa.PrivateKey, error) + func LoadRSAPrivateKeyPKCS8(priKey []byte) (*rsa.PrivateKey, error) + func LoadRootCa(caFile string, keyFile string) (*x509.Certificate, *rsa.PrivateKey, error) + func MD5(data []byte) ([]byte, error) + func Number(maxNum uint64) (uint64, error) + func Password(length uint64) (string, error) + func RsaDecryptRSA(cipherText []byte, myPriKey *rsa.PrivateKey) ([]byte, error) + func RsaEncryptRSA(plainText []byte, peerPubKey *rsa.PublicKey) ([]byte, error) + func SaveCert2File(cert *pem.Block, key *pem.Block, certFile string, keyFile string) error + func Sha1(data []byte) ([]byte, error) + func Sha256(data []byte) ([]byte, error) + func Sha512(data []byte) ([]byte, error) + func SignWithSha256RSA(data []byte, myPriKey []byte) ([]byte, error) + func String(length int) (string, error) + func VerySignWithSha256RSA(originalDataHash []byte, signedDataHash []byte, peerPubKey []byte) error + type Curve22519Ecdh struct + PrivateKey string + PublicKey string + func NewCurve22519Ecdh() *Curve22519Ecdh + func (c *Curve22519Ecdh) GenerateKeyPair() error + func (c *Curve22519Ecdh) GetPublicKey() string + func (c *Curve22519Ecdh) GetSharedKey(peerPubKey string) (string, error)