Documentation ¶
Overview ¶
Package hashutil contains misc hashing functions lacking homes elsewhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SHA1Prefix ¶
SHA1Prefix computes the SHA-1 digest of data and returns its first twenty lowercase hex digits.
func SHA256Prefix ¶
SHA256Prefix computes the SHA-256 digest of data and returns its first twenty lowercase hex digits.
Types ¶
type TrackDigestReader ¶
type TrackDigestReader struct { // DoLegacySHA1 sets whether to also compute the legacy SHA-1 hash. DoLegacySHA1 bool // contains filtered or unexported fields }
TrackDigestReader is an io.Reader wrapper which records the digest of what it reads.
func NewTrackDigestReader ¶
func NewTrackDigestReader(r io.Reader) *TrackDigestReader
func (*TrackDigestReader) Hash ¶
func (t *TrackDigestReader) Hash() hash.Hash
Hash returns the current hash sum.
func (*TrackDigestReader) LegacySHA1Hash ¶
func (t *TrackDigestReader) LegacySHA1Hash() hash.Hash
LegacySHA1Hash returns the current legacy SHA-1 hash sum.
Click to show internal directories.
Click to hide internal directories.