Documentation ¶
Index ¶
- func ConvertToString(src, srcCode, tagCode string) string
- func CreateToken(subject string, expire time.Duration, secret []byte) (string, error)
- func DecrptogAES(src, key string) string
- func EncyptogAES(src, key string) string
- func GenerateRSAKey(bits int) (pubKey, priKey []byte, err error)
- func IdsUniqueFitter(ids []int) []int
- func MD5(value string) string
- func MsgTplCompile(tpl string, args []string) string
- func MustUtf8(s string) string
- func NewLockTable() *lockTable
- func PanicToError(f func()) (err error)
- func PanicTrace(err interface{}) string
- func ParseArrString(str, sep string, dto interface{}) error
- func ParseToken(tokenString string, secret []byte) (string, error)
- func PasswordHash(pwd string) string
- func PasswordVerify(hashedPwd string, plainPwd string) bool
- func RSADecrypt(cipherText []byte, key []byte) ([]byte, error)
- func RSAEncrypt(plainText []byte, key []byte) ([]byte, error)
- func SuperConvert(fromStruct interface{}, toStruct interface{})
- func Validator(err error) string
- type SafeStringMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToString ¶
ConvertToString 转换字符串编码 src 字符串 srccode 源编码 tagCode 目标编码
func CreateToken ¶
CreateToken 生成jwtToken
func GenerateRSAKey ¶
GenerateRSAKey 生成RSA私钥和公钥,保存到文件中
func MsgTplCompile ¶
MsgTplCompile 字符串模板渲染 "您的验证码{0},过期时间{1}分钟", ["123", "5"] => 您的验证码123,过期时间5分钟
func ParseArrString ¶
ParseArrString 解析字符串数组 str 待解析字符串 sep 分割符号 dto 期望解析切片(指针)
func ParseToken ¶
ParseToken 解析jwtToken
func PasswordVerify ¶
PasswordVerify 密码验证
func SuperConvert ¶
func SuperConvert(fromStruct interface{}, toStruct interface{})
SuperConvert 使用反射,转换结构体 仅支持单层级
Types ¶
type SafeStringMap ¶
SafeStringMap 安全map
Click to show internal directories.
Click to hide internal directories.