Documentation
¶
Index ¶
- func CheckMd5(originStr, md5Str string) bool
- func CheckMd5WithKey(key, originStr, md5Str string) bool
- func CheckSha1(originStr, md5Str string) bool
- func CheckSha1WithKey(key, originStr, sha1Str string) bool
- func CheckSha256WithKey(key, originStr, sha1Str string) bool
- func CheckSha512WithKey(key, originStr, sha1Str string) bool
- func Exists(path string) bool
- func GetMd5(text string) string
- func GetMd5WithKey(key, data string) string
- func GetSha1(text string) string
- func GetSha1WithKey(key, data string) string
- func GetSha256WithKey(key, data string) string
- func GetSha512WithKey(key, data string) string
- func Sha256EncryptString(data, salt string) (string, error)
- func Sha256ValidateString(data, salt, encrypted string) bool
- type Config
- type HttpServerInfo
- type Password
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMd5 ¶ added in v1.3.1
CheckMd5 检查加密字符串是否正确 @param md5Str md5加密后的16进制字符串 @param originStr 要检查的加密前的数据 返回一个布尔值
func CheckMd5WithKey ¶ added in v1.3.1
CheckMd5WithKey 使用指定key检查字符串是否和md5加密后的字符串相同 @param key 指定的加密key @param originStr 加密前字符串 @param md5Str 加密后字符串
func CheckSha1WithKey ¶ added in v1.3.1
func CheckSha256WithKey ¶ added in v1.3.1
func CheckSha512WithKey ¶ added in v1.3.1
func GetMd5WithKey ¶ added in v1.3.1
GetMd5WithKey 使用指定key获取一个文本的md5值
func GetSha1WithKey ¶ added in v1.3.1
func GetSha256WithKey ¶ added in v1.3.1
func GetSha512WithKey ¶ added in v1.3.1
func Sha256EncryptString ¶ added in v1.3.3
Sha256EncryptString 加密字符串
func Sha256ValidateString ¶ added in v1.3.3
Sha256ValidateString 校验字符串是否符合加密后的要求
Types ¶
type Config ¶ added in v1.2.0
type Config struct {
Aes aes.AesConfig `yaml:"aes" json:"aes"` // AES加密核心配置
Hash hash.HashConfig `yaml:"hash" json:"hash"` // HASH加密核心配置
KeyPath string `yaml:"key_path" json:"key_path"`
}
Config 密码配置对象
type HttpServerInfo ¶ added in v1.2.7
type HttpServerInfo struct {
Host string `json:"host"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
Role int `json:"role"`
IsSsl bool `json:"is_ssl"`
Data map[string]interface{} `json:"data"`
}
HttpServerInfo HTTP服务信息
type Password ¶ added in v1.1.2
type Password struct {
Config *Config // 配置对象
Aes *aes.Aes // AES加密核心对象
Hash *hash.Hash // HASH加密核心对象
Url *zurl.Url // URL编码解码核心对象
Hex *hex.Hex // 十六进制编码解码
BytesMap map[string][]byte // 用于存放bytes数组的字典
}
Password 密码加密核心对象
func NewWithConfig ¶ added in v1.2.3
NewWithConfig 创建加密对象
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
aes_dump_load
command
|
|
|
aes_dump_load_http_info
command
|
|
|
aes_dump_load_update
command
|
|
|
aes_load_update_fs
command
|
|
|
c01_hash
command
|
|
|
c02_sha256
command
|
|
|
c02_sha2562
command
|
|
|
z02_aes
command
|
|
|
Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0.
|
Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0. |
Click to show internal directories.
Click to hide internal directories.