Documentation
¶
Index ¶
- Constants
- Variables
- func Encrypt(raw string) string
- func EncryptWithHash(raw, hashAlgo string) string
- func EncryptWithOption(raw string, opt *EncryptOption) string
- func HashWithDefault(data []byte, hashKey string) []byte
- func NewHashFunc(algorithm string) (hash.Hash, error)
- func NewHashFuncForPBKDF2(algorithm string) (func() hash.Hash, error)
- func NewHashFuncForPBKDF2WithDefault(algorithm string) (func() hash.Hash, string)
- func NewHashFuncWithDefault(algorithm string) (hash.Hash, string)
- func Verify(raw, encrypted string) bool
- func VerifyHashWithDefault(row []byte, enp []byte, hashKey string) bool
- func VerifyWithError(raw, encrypted string) (string, bool)
- type EncryptOption
- type Hasher
Constants ¶
View Source
const ( SHA1 = "sha1" SHA256 = "sha256" SHA512 = "sha512" SHA3_256 = "sha3-256" SHA3_512 = "sha3-512" MD5 = "md5" Murmur32 = "murmur32" Murmur64 = "murmur64" Murmur128 = "murmur128" )
Variables ¶
View Source
var (
ErrUndefinedHashFunc = errors.New("未定义的HashFunc")
)
Functions ¶
func EncryptWithHash ¶
func EncryptWithOption ¶
func EncryptWithOption(raw string, opt *EncryptOption) string
func HashWithDefault ¶
func VerifyHashWithDefault ¶
func VerifyWithError ¶
Types ¶
type EncryptOption ¶
Click to show internal directories.
Click to hide internal directories.