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 ¶
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 MD5Hmac ¶
MD5Hmac computes the HMAC-MD5 of the input data with the given key. WARNING: MD5 is cryptographically broken. Use SHA256Hmac instead.
func SHA1 ¶
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 ¶
SHA1Bytes computes the SHA-1 hash of the input bytes and returns a hex-encoded string.
func SHA1Hmac ¶
SHA1Hmac computes the HMAC-SHA1 of the input data with the given key. WARNING: SHA-1 is cryptographically weak. Use SHA256Hmac instead.
func SHA256 ¶
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 ¶
SHA256Bytes computes the SHA-256 hash of the input bytes and returns a hex-encoded string.
func SHA256Hmac ¶
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 ¶
SHA512 computes the SHA-512 hash of the input string and returns a hex-encoded string.
func SHA512Bytes ¶
SHA512Bytes computes the SHA-512 hash of the input bytes and returns a hex-encoded string.
func SHA512Hmac ¶
SHA512Hmac computes the HMAC-SHA512 of the input data with the given key.
func SM3 ¶
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.