README ¶ easyhash 哈希散列 包装标准库的方法,简化操作步骤,使一步完成哈希操作。 只需一行代码就可以获取 MD5 或 BLAKE2B 哈希结果。 示例: package main import ( "gitee.com/sillyman/simpleUtil/common/easyhash" "fmt" ) func main(){ hashRes := easyhash.BLAKE2b256("岳阳小罗", []byte("secure_salt")) fmt.Println(hashRes) // output: a7cd5573ea38d1d7557ea5ae0f6a1149ca17175a6888701d9c2545a7e41c242b } Expand ▾ Collapse ▴ Documentation ¶ Overview ¶ Package easyhash 包装哈希散列方法,使其一步完成 Index ¶ func BLAKE2b256(s string, salt []byte) string func EasyHash(h hash.Hash, r io.Reader, salt []byte) ([]byte, error) func GMSM3(s string, salt []byte) string func Hex2Str(data []byte) string func MD5(s string, salt []byte) string func MustEasyHash(h hash.Hash, r io.Reader, salt []byte) []byte Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func BLAKE2b256 ¶ func BLAKE2b256(s string, salt []byte) string BLAKE2b256 使用 crypto.BLAKE2b_256 进行哈希 func EasyHash ¶ func EasyHash(h hash.Hash, r io.Reader, salt []byte) ([]byte, error) EasyHash 使用指定的哈希算法 crypto.BLAKE2b_256 是速度和安全性非常好哈希算法,推荐使用 func GMSM3 ¶ func GMSM3(s string, salt []byte) string GMSM3 国密 sm3 哈希 func Hex2Str ¶ func Hex2Str(data []byte) string func MD5 ¶ func MD5(s string, salt []byte) string MD5 func MustEasyHash ¶ func MustEasyHash(h hash.Hash, r io.Reader, salt []byte) []byte Types ¶ This section is empty. Source Files ¶ View all Source files blake2b.goeasyhash.gogmsm3.gomd5.go Click to show internal directories. Click to hide internal directories.