Documentation ¶
Index ¶
- func BytesToInt(b []byte) uint64
- func BytesToString(b []byte) string
- func Generate2048RSAKey() (pri, pub []byte, err error)
- func GenerateRSAKey(bits int) (pri, pub []byte, err error)
- func GetClientIp(ctx *gin.Context) string
- func GetLocalIp() string
- func IntToBytes(n uint64) []byte
- func IsFileExists(filePath string) bool
- func JSONBytesToStruct(jsonByte []byte, s interface{}) error
- func JSONStrToStruct(jsonStr string, s interface{}) error
- func Join(sep string, elems []uint64) string
- func LoadConf(configPath string, s interface{}) error
- func MD5(content string) string
- func MapToStruct(mp map[string]string, s interface{}) error
- func RandomID() string
- func RsaDecrypt(ciphertext, privateKey []byte) ([]byte, error)
- func RsaEncrypt(origData, publicKey []byte) ([]byte, error)
- func StringToBytes(s string) (b []byte)
- func Substr(str string, start int, length int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to string without a memory allocation.
func Generate2048RSAKey ¶
Generate2048RSAKey 生成RSA私钥和公钥(2048位)
func GenerateRSAKey ¶
GenerateRSAKey 生成RSA私钥和公钥
func IsFileExists ¶
func JSONBytesToStruct ¶
func JSONStrToStruct ¶
func Join ¶
Join concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string.
func MapToStruct ¶
func StringToBytes ¶
StringToBytes converts string to byte slice without a memory allocation.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.