xhash

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

func Base64HashReader(h hash.Hash, r io.Reader) (string, error)

Base64HashReader 根据提供的 hash.Hash 对象计算 io.Reader 具体内容的 base64 hash

func Base64HashString

func Base64HashString(h hash.Hash, s string) (string, error)

Base64HashString 根据提供的 hash.Hash 对象计算所给 s 字符串具体内容的 base64 hash

func CmpHashAndPwd

func CmpHashAndPwd(hashedPwd, plainPwd string) bool

CmpHashAndPwd 将密码的 bcrypt hash 与其可能的等效明文密码进行比较

func GenFromPwd

func GenFromPwd(pwd string) (string, error)

GenFromPwd 生成密码的 bcrypt hash

func HashFile

func HashFile(h hash.Hash, filePath string, fileName ...string) (string, error)

HashFile 根据提供的 hash.Hash 对象计算文件路径指向的文件具体内容的 hash, 若传递不为空的文件名称参数,则会在文件具体内容后追加文件名称然后计算 hash

func HashReader

func HashReader(h hash.Hash, r io.Reader) (string, error)

HashReader 根据提供的 hash.Hash 对象计算 io.Reader 具体内容的 hash

func HashString

func HashString(h hash.Hash, s string) (string, error)

HashString 根据提供的 hash.Hash 对象计算所给 s 字符串具体内容的 hash

func New

func New(digest string) hash.Hash

New 根据提供的摘要名称新建 hash.Hash 对象

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL