Documentation ¶
Index ¶
- func Hash128x64(key []byte) []byte
- func Hash32(key []byte) uint32
- func WriteHash128x64(key, ret []byte)
- type Hash128Value
- type HashWriter128
- func (hw *HashWriter128) AddBytes(input []byte)
- func (hw *HashWriter128) AddString(key string)
- func (hw *HashWriter128) BlockSize() int
- func (hw *HashWriter128) Reset()
- func (hw *HashWriter128) Size() int
- func (hw *HashWriter128) Sum(b []byte) []byte
- func (hw *HashWriter128) Sum128() Hash128Value
- func (hw *HashWriter128) Write(b []byte) (int, error)
- func (hw *HashWriter128) WriteString(s string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hash128x64 ¶
Hash128x64 calls WriteHash128x64 with an allocated output buffer
func WriteHash128x64 ¶
func WriteHash128x64(key, ret []byte)
WriteHash128x64 creates a hash of key and writes it to ret
Types ¶
type Hash128Value ¶
type Hash128Value struct {
// contains filtered or unexported fields
}
func Hash128 ¶
func Hash128(key []byte) Hash128Value
Hash128 s a version of MurmurHash which is designed to run only on little-endian processors
func (Hash128Value) Bytes ¶
func (h Hash128Value) Bytes() []byte
Bytes returns the 16 bytes that compose the hash
func (Hash128Value) Values ¶
func (h Hash128Value) Values() (uint64, uint64)
Values returns the two 8 byte values that compose the hash
func (Hash128Value) Write ¶
func (h Hash128Value) Write(out []byte)
Write writes the hash to given buffer which should be 16 bytes long
type HashWriter128 ¶
type HashWriter128 struct {
// contains filtered or unexported fields
}
func (*HashWriter128) AddBytes ¶
func (hw *HashWriter128) AddBytes(input []byte)
AddBytes adds the given bytes to the hash
func (*HashWriter128) AddString ¶
func (hw *HashWriter128) AddString(key string)
AddString adds the given string to the hash
func (*HashWriter128) BlockSize ¶
func (hw *HashWriter128) BlockSize() int
func (*HashWriter128) Reset ¶
func (hw *HashWriter128) Reset()
func (*HashWriter128) Size ¶
func (hw *HashWriter128) Size() int
func (*HashWriter128) Sum ¶
func (hw *HashWriter128) Sum(b []byte) []byte
Sum completes the hash and _appends_ the hash to the given input buffer This is kept for backwards compatibility
func (*HashWriter128) Sum128 ¶
func (hw *HashWriter128) Sum128() Hash128Value
Sum completes the hash value and returns it. Reset should be called after calling Sum
func (*HashWriter128) Write ¶
func (hw *HashWriter128) Write(b []byte) (int, error)
Write writes the given bytes to the hash
func (*HashWriter128) WriteString ¶
func (hw *HashWriter128) WriteString(s string) (int, error)
WriteString writes the given string to the hash