hash

package
v1.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: BSD-3-Clause, ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blake3OfBytes

func Blake3OfBytes(by []byte) []byte

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

func Blake3OfBytesString(by []byte) string

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 Blake3OfFile(path string) (blake3sum string, err error)

func SumToString added in v1.7.0

func SumToString(h *blake3.Hasher) string

Types

type Blake3

type Blake3 struct {
	// contains filtered or unexported fields
}

Blake3 provides Hash32 which is goroutine safe.

func NewBlake3

func NewBlake3() *Blake3

NewBlake3 creates a new Blake3.

func (*Blake3) Hash32

func (b *Blake3) Hash32(by []byte) string

func (*Blake3) LockedDigest256

func (b *Blake3) LockedDigest256(by []byte) (digest []byte)

func (*Blake3) LockedDigest512

func (b *Blake3) LockedDigest512(by []byte) (digest []byte)

func (*Blake3) Reset

func (b *Blake3) Reset()

func (*Blake3) SumString

func (b *Blake3) SumString() string

func (*Blake3) UnlockedDigest256

func (b *Blake3) UnlockedDigest256(by []byte) (digest []byte)

func (*Blake3) UnlockedDigest512

func (b *Blake3) UnlockedDigest512(by []byte) (digest []byte)

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.

func (*Blake3) Write

func (b *Blake3) Write(by []byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL