Documentation ¶
Index ¶
- func Blake3OfBytes(by []byte) []byte
- func Blake3OfBytesString(by []byte) string
- func Blake3OfFile(path string) (blake3sum string, err error)
- func SumToString(h *blake3.Hasher) string
- type Blake3
- func (b *Blake3) Hash32(by []byte) string
- func (b *Blake3) LockedDigest256(by []byte) (digest []byte)
- func (b *Blake3) LockedDigest512(by []byte) (digest []byte)
- func (b *Blake3) Reset()
- func (b *Blake3) SumString() string
- func (b *Blake3) UnlockedDigest256(by []byte) (digest []byte)
- func (b *Blake3) UnlockedDigest512(by []byte) (digest []byte)
- func (b *Blake3) Write(by []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Blake3OfBytes ¶
Blake3OfBytes is goroutine safe and lock free, since it creates a new hasher every time. Benchmarks (see blake3_test.go herein) suggest all these methods are about the same speed.
func Blake3OfBytesString ¶
Blake3OfBytesString calls Blake3OfBytes and is goroutine safe and lock free, since it creates a new hasher every time. Benchmarks (see blake3_test.go herein) suggest all these methods are about the same speed. The returned string starts with the "blake3.32B-" prefix.
func Blake3OfFile ¶ added in v1.7.0
func SumToString ¶ added in v1.7.0
Types ¶
type Blake3 ¶
type Blake3 struct {
// contains filtered or unexported fields
}
Blake3 provides Hash32 which is goroutine safe.
func (*Blake3) LockedDigest256 ¶
func (*Blake3) LockedDigest512 ¶
func (*Blake3) UnlockedDigest256 ¶
func (*Blake3) UnlockedDigest512 ¶
UnlockedDigest512 is not goroutine safe; use the Locked version if this is needed. The output digest is 64 bytes (512 bits), and can be truncated to get smaller hashes.