Documentation ¶
Index ¶
Constants ¶
View Source
const ( // AlgorithmSHA1 is sha1 algorithm name of hash. AlgorithmSHA1 = "sha1" // AlgorithmSHA256 is sha256 algorithm name of hash. AlgorithmSHA256 = "sha256" // AlgorithmSHA512 is sha512 algorithm name of hash. AlgorithmSHA512 = "sha512" // AlgorithmMD5 is md5 algorithm name of hash. AlgorithmMD5 = "md5" )
Variables ¶
This section is empty.
Functions ¶
func MD5FromBytes ¶
MD5FromBytes computes the MD5 checksum with []byte.
func MD5FromReader ¶
MD5FromReader computes the MD5 checksum with io.Reader.
func SHA256FromBytes ¶
SHA256FromBytes computes the SHA256 checksum with []byte.
func SHA256FromStrings ¶
SHA256FromStrings computes the SHA256 checksum with multiple strings.
Types ¶
type Digest ¶
type Digest struct { // Algorithm is hash algorithm. Algorithm string // Encoded is hash encode. Encoded string }
Digest provides digest operation function.
type Option ¶
type Option func(reader *reader)
Option is a functional option for digest reader.
func WithEncoded ¶
WithEncoded sets the encoded to be verified.
func WithLogger ¶
func WithLogger(logger *logger.SugaredLoggerOnWith) Option
WithLogger sets the logger for digest reader.
Click to show internal directories.
Click to hide internal directories.