Documentation
¶
Index ¶
- func Md5(data string) string
- func Md5Bytes(data []byte) string
- func Md5Hmac(key, data []byte) string
- func Sha1(data string) string
- func Sha1Bytes(data []byte) string
- func Sha1Hmac(key, data []byte) string
- func Sha256(data string) string
- func Sha256Bytes(data []byte) string
- func Sha256Hmac(key, data []byte) string
- func Sha512(data string) string
- func Sha512Bytes(data []byte) string
- func Sha512Hmac(key, data []byte) string
- func Sm3(data string) string
- func Sm3Bytes(data []byte) string
- func Sm3Hmac(key, data []byte) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Md5 ¶ added in v0.6.0
Md5 computes the MD5 hash of the input string and returns a hex-encoded string. WARNING: MD5 is cryptographically broken and should not be used for security purposes. Use it only for non-security purposes like checksums.
func Md5Bytes ¶ added in v0.6.0
Md5Bytes computes the MD5 hash of the input bytes and returns a hex-encoded string.
func Md5Hmac ¶ added in v0.6.0
Md5Hmac computes the HMAC-MD5 of the input data with the given key. WARNING: MD5 is cryptographically broken. Use Sha256Hmac instead.
func Sha1 ¶ added in v0.6.0
Sha1 computes the SHA-1 hash of the input string and returns a hex-encoded string. WARNING: SHA-1 is cryptographically broken and should not be used for security purposes. Consider using Sha256 or Sha512 instead.
func Sha1Bytes ¶ added in v0.6.0
Sha1Bytes computes the SHA-1 hash of the input bytes and returns a hex-encoded string.
func Sha1Hmac ¶ added in v0.6.0
Sha1Hmac computes the HMAC-SHA1 of the input data with the given key. WARNING: SHA-1 is cryptographically weak. Use Sha256Hmac instead.
func Sha256 ¶ added in v0.6.0
Sha256 computes the SHA-256 hash of the input string and returns a hex-encoded string. This is the recommended hash function for most use cases.
func Sha256Bytes ¶ added in v0.6.0
Sha256Bytes computes the SHA-256 hash of the input bytes and returns a hex-encoded string.
func Sha256Hmac ¶ added in v0.6.0
Sha256Hmac computes the HMAC-SHA256 of the input data with the given key. This is the recommended HMAC function for most use cases.
func Sha512 ¶ added in v0.6.0
Sha512 computes the SHA-512 hash of the input string and returns a hex-encoded string.
func Sha512Bytes ¶ added in v0.6.0
Sha512Bytes computes the SHA-512 hash of the input bytes and returns a hex-encoded string.
func Sha512Hmac ¶ added in v0.6.0
Sha512Hmac computes the HMAC-SHA512 of the input data with the given key.
func Sm3 ¶ added in v0.6.0
Sm3 computes the SM3 hash of the input string and returns a hex-encoded string. SM3 is a cryptographic hash function used in Chinese National Standard (国密算法).
Types ¶
This section is empty.