Documentation
¶
Index ¶
- Constants
- func Base64HashReader(h hash.Hash, r io.Reader) (string, error)
- func Base64HashString(h hash.Hash, s string) (string, error)
- func CmpHashAndPwd(hashedPwd, plainPwd string) bool
- func GenFromPwd(pwd string) (string, error)
- func HashFile(h hash.Hash, filePath string, fileName ...string) (string, error)
- func HashReader(h hash.Hash, r io.Reader) (string, error)
- func HashString(h hash.Hash, s string) (string, error)
- func New(digest string) hash.Hash
Constants ¶
View Source
const ( MD5 = "md5" SM3 = "sm3" SHA1 = "sha1" SHA224 = "sha224" SHA256 = "sha256" SHA384 = "sha384" SHA512 = "sha512" )
摘要名称
Variables ¶
This section is empty.
Functions ¶
func Base64HashReader ¶
Base64HashReader 根据提供的 hash.Hash 对象计算 io.Reader 具体内容的 base64 hash
func Base64HashString ¶
Base64HashString 根据提供的 hash.Hash 对象计算所给 s 字符串具体内容的 base64 hash
func CmpHashAndPwd ¶
CmpHashAndPwd 将密码的 bcrypt hash 与其可能的等效明文密码进行比较
func HashFile ¶
HashFile 根据提供的 hash.Hash 对象计算文件路径指向的文件具体内容的 hash, 若传递不为空的文件名称参数,则会在文件具体内容后追加文件名称然后计算 hash
func HashReader ¶
HashReader 根据提供的 hash.Hash 对象计算 io.Reader 具体内容的 hash
func HashString ¶
HashString 根据提供的 hash.Hash 对象计算所给 s 字符串具体内容的 hash
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.