Documentation
¶
Overview ¶
Package helper universal tool package
Index ¶
- func CheckSign(timestamp, nonce, body, signature, pubKeyStr string) (bool, error)
- func GenSign(method, url, timestamp, nonce, body string, privateKey *rsa.PrivateKey) (sign string, err error)
- func GetCurrTS() int64
- func OrderParam(p map[string]string, bizKey string) (returnStr string)
- func PemToRSAPublicKey(pemKeyStr string) (*rsa.PublicKey, error)
- func Query(params map[string]interface{}) string
- func RSADecrypt(privateKey string, ciphertext []byte) ([]byte, error)
- func RSADecryptBase64(privateKey string, cryptoText string) ([]byte, error)
- func RandomStr(n int) string
- func SliceChunk(src []string, chunkSize int) (chunks [][]string)
- func Template(source string, data map[string]interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenSign ¶
func GenSign(method, url, timestamp, nonce, body string, privateKey *rsa.PrivateKey) (sign string, err error)
GenSign 生成签名
func OrderParam ¶ added in v0.0.3
OrderParam order params
func PemToRSAPublicKey ¶
PemToRSAPublicKey pem to rsa public key
func RSADecrypt ¶ added in v0.0.3
RSADecrypt 数据解密
func RSADecryptBase64 ¶ added in v0.0.3
RSADecryptBase64 Base64 解码后再次进行 RSA 解密
func SliceChunk ¶ added in v0.0.3
SliceChunk 用于将字符串切片分块
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.