func Hash(b []byte) uint64
Hash returns the hash of the byte slice.
func HashSeed(b []byte, seed uint64) uint64
HashSeed returns the hash of the byte slice with given seed.
func HashString(s string) uint64
Hash returns the hash of the string slice.
func HashStringSeed(s string, seed uint64) uint64
HashStringSeed returns the hash of the string slice with given seed.
Hasher implements the hash.Hash interface
type Hasher struct {
// contains filtered or unexported fields
}
func New() *Hasher
New returns a new Hasher that implements the hash.Hash interface.
func NewSeed(seed uint64) *Hasher
NewSeed returns a new Hasher that implements the hash.Hash interface.
func (h *Hasher) BlockSize() int
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 (h *Hasher) Reset()
Reset resets the Hash to its initial state.
func (h *Hasher) Size() int
Size returns the number of bytes Sum will return.
func (h *Hasher) Sum(b []byte) []byte
Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.
func (h *Hasher) Sum128() Uint128
Sum128 returns the 128-bit hash of the written data.
func (h *Hasher) Sum64() uint64
Sum64 returns the 64-bit hash of the written data.
func (h *Hasher) Write(buf []byte) (int, error)
Write adds more data to the running hash. It never returns an error.
func (h *Hasher) WriteString(buf string) (int, error)
WriteString adds more data to the running hash. It never returns an error.
Uint128 is a 128 bit value. The actual value can be thought of as u.Hi<<64 | u.Lo.
type Uint128 struct { Hi, Lo uint64 }
func Hash128(b []byte) Uint128
Hash128 returns the 128-bit hash of the byte slice.
func Hash128Seed(b []byte, seed uint64) Uint128
Hash128Seed returns the 128-bit hash of the byte slice.
func HashString128(s string) Uint128
HashString128 returns the 128-bit hash of the string slice.
func HashString128Seed(s string, seed uint64) Uint128
HashString128Seed returns the 128-bit hash of the string slice.
func (u Uint128) Bytes() [16]byte
Bytes returns the uint128 as an array of bytes in canonical form (big-endian encoded).
Name | Synopsis |
---|---|
.. |