Documentation ¶
Index ¶
- func Check()
- func Hash232(k []byte, seed uint32) uint32
- func Hash264(k []byte, seed uint64) uint64
- func HashBytesLength(k []byte, length int, seed uint32) uint32
- func HashString(s string, pc, pb uint32) (rpc, rpb uint32)
- func HashWords332(k []uint32, seed uint32) uint32
- func HashWordsLen(k []uint32, length int, seed uint32) uint32
- func Jenkins364(k []byte, length int, pc, pb uint32) (rpc, rpb uint32)
- func New(seed uint32) hash.Hash32
- func New232(seed uint32) nhash.HashF32
- func New332c(seed uint32) nhash.HashF32
- func New364(seed uint64) nhash.Hash64
- func Sum32(data []byte, seed uint32) uint32
- func XHashWords(k []uint32, length int, seed uint32) uint32
- type State232
- func (s *State232) BlockSize() int
- func (s *State232) Hash32(b []byte, seeds ...uint32) uint32
- func (s *State232) HashSizeInBits() int
- func (s *State232) NumSeedBytes() int
- func (s *State232) Reset()
- func (s *State232) Size() int
- func (s *State232) Sum(b []byte) []byte
- func (s *State232) Sum32() uint32
- func (s *State232) Write(p []byte) (nn int, err error)
- type State264
- type State332
- type State332b
- type State332c
- func (d *State332c) BlockSize() int
- func (d *State332c) Hash32(b []byte, seeds ...uint32) uint32
- func (d *State332c) HashSizeInBits() int
- func (d *State332c) NumSeedBytes() int
- func (d *State332c) Reset()
- func (d *State332c) Size() int
- func (d *State332c) Sum(b []byte) []byte
- func (d *State332c) Sum32() uint32
- func (d *State332c) Write(p []byte) (nn int, err error)
- type State364
- func (d *State364) BlockSize() int
- func (d *State364) Hash64(b []byte, seeds ...uint64) uint64
- func (d *State364) Hash64S(b []byte, seed uint64) uint64
- func (d *State364) HashSizeInBits() int
- func (d *State364) NumSeedBytes() int
- func (d *State364) Reset()
- func (d *State364) Size() int
- func (d *State364) Sum(b []byte) []byte
- func (d *State364) Sum64() uint64
- func (d *State364) Write(p []byte) (nn int, err error)
- func (d *State364) Write64(h uint64) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hash232 ¶
Jenkin's second generation 32 bit hash. Benchmarked with 4 byte key, inlining, and no store of hash at: benchmark32: 55 Mhashes/sec benchmark32: 219 MB/sec
func Hash264 ¶
Jenkin's second generation 64 bit hash. Benchmarked with 24 byte key, inlining, store of hash in memory (cache miss every 4 hashes) and fast=true at: benchmark64: 26 Mhashes/sec benchmark64: 623 MB/sec
func HashString ¶
func HashWords332 ¶
func Jenkins364 ¶
jenkins364: return 2 32-bit hash values. Returns two 32-bit hash values instead of just one. This is good enough for hash table lookup with 2^^64 buckets, or if you want a second hash if you're not happy with the first, or if you want a probably-unique 64-bit ID for the key. *pc is better mixed than *pb, so use *pc first. If you want a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)"
func New232 ¶
New returns a new nhash.HashF32 interface that computes a 32 bit jenkins lookup3 hash.
func New332c ¶
New returns a new nhash.HashF32 interface that computes a 32 bit jenkins lookup3 hash.
func New364 ¶
changed this from HashF64 to Hash64 to get streaming functions, what did I break? 7-22-15
Types ¶
type State232 ¶
type State232 struct {
// contains filtered or unexported fields
}
func (*State232) BlockSize ¶
Return the blocksize of the hash which in this case is 12 bytes at a time.
func (*State232) HashSizeInBits ¶
Return the number of bits the hash function outputs.
func (*State232) NumSeedBytes ¶
Return the maximum number of seed bypes required.
type State332c ¶
type State332c struct {
State332
}
func (*State332c) Hash32 ¶
Given b as input and an optional 32 bit seed return the Jenkins lookup3 hash c bits.
func (*State332c) HashSizeInBits ¶
Return the number of bits the hash function outputs.
func (*State332c) NumSeedBytes ¶
Return the maximum number of seed bypes required. In this case 2 x 32
type State364 ¶
type State364 struct {
// contains filtered or unexported fields
}
func (*State364) HashSizeInBits ¶
Return the number of bits the hash function outputs.
func (*State364) NumSeedBytes ¶
Return the maximum number of seed bypes required. In this case 2 x 32