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.
Click to show internal directories.
Click to hide internal directories.