Documentation
¶
Overview ¶
Package hashing implements different hashers and their funcionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeHasher ¶
type FakeHasher struct {
// contains filtered or unexported fields
}
FakeHasher implements the Hasher interface and computes a hash function depending on the caller. Here, 'Salted' function does nothing but act as a passthrough to 'Do' function. Handy for testing hash tree implementations.
func (*FakeHasher) Do ¶
func (h *FakeHasher) Do(data ...[]byte) Digest
Do function hashes input data using the hashing function given by the KeyHasher.
func (FakeHasher) Len ¶
func (h FakeHasher) Len() uint16
Len function returns the size of the resulting hash.
type Hasher ¶
func NewBlake2bHasher ¶
func NewBlake2bHasher() Hasher
NewBlake2bHasher implements the Hasher interface and computes a 256 bit hash function using the Blake2 hashing algorithm.
func NewFakePearsonHasher ¶
func NewFakePearsonHasher() Hasher
func NewFakeSha256Hasher ¶
func NewFakeSha256Hasher() Hasher
func NewFakeXorHasher ¶
func NewFakeXorHasher() Hasher
func NewPearsonHasher ¶
func NewPearsonHasher() Hasher
func NewSha256Hasher ¶
func NewSha256Hasher() Hasher
NewSha256Hasher implements the Hasher interface and computes a 256 bit hash function using the SHA256 hashing algorithm.
func NewXorHasher ¶
func NewXorHasher() Hasher
type KeyHasher ¶
type KeyHasher struct {
// contains filtered or unexported fields
}
func (*KeyHasher) Do ¶
Do function hashes input data using the hashing function given by the KeyHasher.
type PearsonHasher ¶
type PearsonHasher struct{}
PearsonHasher implements the Hasher interface and computes a 8 bit hash function. Handy for testing hash tree implementations.
func (*PearsonHasher) Do ¶
func (p *PearsonHasher) Do(data ...[]byte) Digest
Do function hashes input data using the Pearson hash function.
func (PearsonHasher) Len ¶
func (p PearsonHasher) Len() uint16
Len function returns the size of the resulting hash.
type XorHasher ¶
type XorHasher struct{}
XorHasher implements the Hasher interface and computes a 2 bit hash function. Handy for testing hash tree implementations.