hash

package
v0.1.23-oss Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash interface {
	String() string               // Return string representation of the hash
	IsEmptyDir() bool             // Compare against empty directory hash
	IsEmptyFile() bool            // Compare against empty file hash
	IsZero() bool                 // Compare against a zero hash
	Equals(rhs Hash) bool         // Compare two hash values
	Read(io.Reader) (int, error)  // Read the hash data from input
	Write(io.Writer) (int, error) // Write the hash data from input
	Data() []byte                 // Access raw data of hash
}

Hash object used in the CAS library.

type HashFunc

type HashFunc interface {
	io.Writer        // Write data to the hash function
	Sum([]byte) Hash // Append the input data and return Hash for the data
	Size() int       // Size of the hash
}

Create hash from data

type Hasher

type Hasher interface {
	NewHash(h string) (Hash, error) // Create new hash based on string representation
	ZeroHash() Hash                 // Create a zero hash
	EmptyDirHash() Hash             // Create empty dir hash
	EmptyFileHash() Hash            // Create empty file hash
	New() HashFunc                  // Create new hasher function to create a hash
}

Hasher used to create new hashes or hash function objects.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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