Documentation ¶
Index ¶
- Variables
- func Dist(hash, i, capacity int64) int64
- func HashKey(key []byte) int64
- func HashUint64(key uint64) int64
- type HashMap
- func (m *HashMap) AverageProbeCount() float64
- func (m *HashMap) Cap() int64
- func (m *HashMap) Elem(i int64) (key []byte, value interface{})
- func (m *HashMap) Get(key []byte) interface{}
- func (m *HashMap) Keys() [][]byte
- func (m *HashMap) Len() int64
- func (m *HashMap) Put(key []byte, val interface{})
- func (m *HashMap) Reset()
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{
Capacity: 256,
LoadFactor: 90,
}
DefaultOptions represents a default set of options to pass to NewHashMap().
Functions ¶
func Dist ¶
Dist returns the probe distance for a hash in a slot index. NOTE: Capacity must be a power of 2.
func HashUint64 ¶
HashUint64 computes a hash of an int64. Hash is always non-zero.
Types ¶
type HashMap ¶
type HashMap struct {
// contains filtered or unexported fields
}
HashMap represents a hash map that implements Robin Hood Hashing. https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf
func NewHashMap ¶
func (*HashMap) AverageProbeCount ¶
AverageProbeCount returns the average number of probes for each element.
Click to show internal directories.
Click to hide internal directories.