Documentation
¶
Index ¶
- func Hash(b []byte) uint64
- func HashSeed(b []byte, seed uint64) uint64
- func HashString(s string) uint64
- func HashStringSeed(s string, seed uint64) uint64
- type Hasher
- func (h *Hasher) BlockSize() int
- func (h *Hasher) Reset()
- func (h *Hasher) ResetSeed(seed uint64)
- func (h *Hasher) Size() int
- func (h *Hasher) Sum(b []byte) []byte
- func (h *Hasher) Sum64() uint64
- func (h *Hasher) Sum128() Uint128
- func (h *Hasher) Write(buf []byte) (int, error)
- func (h *Hasher) WriteString(buf string) (int, error)
- type Hasher128
- func (h *Hasher128) BlockSize() int
- func (h *Hasher128) Reset()
- func (h *Hasher128) ResetSeed(seed uint64)
- func (h *Hasher128) Size() int
- func (h *Hasher128) Sum(b []byte) []byte
- func (h *Hasher128) Sum128() Uint128
- func (h *Hasher128) Write(buf []byte) (int, error)
- func (h *Hasher128) WriteString(buf string) (int, error)
- type Uint128
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashStringSeed ¶ added in v1.0.0
HashStringSeed returns the hash of the string slice with given seed.
Types ¶
type Hasher ¶ added in v0.13.0
type Hasher struct {
// contains filtered or unexported fields
}
Hasher implements the hash.Hash interface
func New ¶ added in v0.13.0
func New() *Hasher
New returns a new Hasher that implements the hash.Hash interface.
func NewSeed ¶ added in v1.0.0
NewSeed returns a new Hasher that implements the hash.Hash interface.
func (*Hasher) BlockSize ¶ added in v0.13.0
BlockSize returns the hash's underlying block size. The Write method will accept any amount of data, but it may operate more efficiently if all writes are a multiple of the block size.
func (*Hasher) Reset ¶ added in v0.13.0
func (h *Hasher) Reset()
Reset resets the Hash to its initial state.
func (*Hasher) ResetSeed ¶ added in v1.1.0
ResetSeed will reset the hash and set a new seed. This will change the original state used by Reset.
func (*Hasher) Sum ¶ added in v0.13.0
Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.
type Hasher128 ¶ added in v1.1.0
type Hasher128 struct {
// contains filtered or unexported fields
}
Hasher128 implements the hash.Hash interface. It will return hashes that are 128 bits.
func New128 ¶ added in v1.1.0
func New128() *Hasher128
New128 returns a new 128 bit Hasher that implements the hash.Hash interface.
func NewSeed128 ¶ added in v1.1.0
NewSeed128 returns a new Hasher128 that implements the hash.Hash interface.
func (*Hasher128) BlockSize ¶ added in v1.1.0
BlockSize returns the hash's underlying block size. The Write method will accept any amount of data, but it may operate more efficiently if all writes are a multiple of the block size.
func (*Hasher128) Reset ¶ added in v1.1.0
func (h *Hasher128) Reset()
Reset resets the Hash to its initial state.
func (*Hasher128) ResetSeed ¶ added in v1.1.0
ResetSeed will reset the hash and set a new seed. This will change the original state used by Reset.
func (*Hasher128) Sum ¶ added in v1.1.0
Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.
type Uint128 ¶ added in v0.11.0
type Uint128 struct {
Hi, Lo uint64
}
Uint128 is a 128 bit value. The actual value can be thought of as u.Hi<<64 | u.Lo.
func Hash128Seed ¶ added in v1.0.0
Hash128Seed returns the 128-bit hash of the byte slice.
func HashString128 ¶ added in v0.9.0
HashString128 returns the 128-bit hash of the string slice.
func HashString128Seed ¶ added in v1.0.0
HashString128Seed returns the 128-bit hash of the string slice.