Documentation
¶
Index ¶
- Constants
- func AESDecryptMsg(ciphertext []byte, aesKey []byte) (random, rawXMLMsg, appID []byte, err error)
- func AESEncryptMsg(random, rawXMLMsg []byte, appID string, aesKey []byte) (ciphertext []byte)
- func AesECBDecrypt(ciphertext []byte, aesKey []byte) ([]byte, error)
- func BinaryToDecimal(bit string) (num int)
- func BytesToString(b []byte) (s string)
- func CalculateSign(content, signType, key string) (string, error)
- func ConvertToMap(content interface{}) map[string]interface{}
- func ConvertToString(v interface{}) (str string)
- func DecryptMsg(appID, encryptedMsg, aesKey string) (random, rawMsgXMLBytes []byte, err error)
- func EncryptMsg(random, rawXMLMsg []byte, appID, aesKey string) (encrtptMsg []byte, err error)
- func Float32ToString(floatNum float32, prec ...int) (floatStr string)
- func Float64ToString(floatNum float64, prec ...int) (floatStr string)
- func Int2String(intNum int) (intStr string)
- func Int642String(intNum int64) (int64Str string)
- func NewECBDecryptor(b cipher.Block) cipher.BlockMode
- func NewECBEncryptor(b cipher.Block) cipher.BlockMode
- func OrderParam(p map[string]string, bizKey string) (returnStr string)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func ParamSign(p map[string]string, key string) (string, error)
- func RandomNumber(l int) string
- func RandomPureString(l int) string
- func RandomString(l int) string
- func String2Float32(floatStr string) (floatNum float32)
- func String2Float64(floatStr string) (floatNum float64)
- func String2Int(intStr string) (intNum int)
- func String2Int64(intStr string) (int64Num int64)
- type ECBDecryptor
- type ECBEncryptor
- type File
Constants ¶
const ( SignTypeMD5 = `MD5` SignTypeHMACSHA256 = `HMAC-SHA256` )
微信签名算法方式
const (
NULL = ""
)
Variables ¶
This section is empty.
Functions ¶
func AESDecryptMsg ¶
AESDecryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId] 参考:github.com/chanxuehong/wechat.v2
func AESEncryptMsg ¶
AESEncryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId] 参考:github.com/chanxuehong/wechat.v2
func AesECBDecrypt ¶
AesECBDecrypt will decrypt data with PKCS5Padding
func BytesToString ¶
BytesToString 0 拷贝转换 slice byte 为 string
func CalculateSign ¶
CalculateSign 计算签名
func ConvertToString ¶
func ConvertToString(v interface{}) (str string)
func DecryptMsg ¶
DecryptMsg 消息解密
func EncryptMsg ¶
EncryptMsg 加密消息
func NewECBDecryptor ¶
NewECBDecryptor returns a BlockMode which decrypts in electronic code book mode, using the given Block.
func NewECBEncryptor ¶
NewECBEncryptor returns a BlockMode which encrypts in electronic code book mode, using the given Block.
func OrderParam ¶
OrderParam order params
Types ¶
type ECBDecryptor ¶
type ECBDecryptor ecb
ECBDecryptor -
func (*ECBDecryptor) BlockSize ¶
func (x *ECBDecryptor) BlockSize() int
BlockSize implement BlockMode.BlockSize
func (*ECBDecryptor) CryptBlocks ¶
func (x *ECBDecryptor) CryptBlocks(dst, src []byte)
CryptBlocks implement BlockMode.CryptBlocks
type ECBEncryptor ¶
type ECBEncryptor ecb
ECBEncryptor -
func (*ECBEncryptor) BlockSize ¶
func (x *ECBEncryptor) BlockSize() int
BlockSize implement BlockMode.BlockSize
func (*ECBEncryptor) CryptBlocks ¶
func (x *ECBEncryptor) CryptBlocks(dst, src []byte)
CryptBlocks implement BlockMode.CryptBlocks