Documentation ¶
Index ¶
- Variables
- func BenchmarkHash1024()
- func BenchmarkHash16()
- func BenchmarkHash5()
- func BenchmarkHash64()
- func BenchmarkHash65536()
- func BytesHash(b []byte, aseed uintptr) uintptr
- func HaveGoodHash() bool
- func Int32Hash(i uint32, aseed uintptr) uintptr
- func Int64Hash(i uint64, aseed uintptr) uintptr
- func RunSMhasher(hashf string, v bool)
- func SetBytes(amt int64)
- func Short() bool
- func StringHash(s string, aseed uintptr) uintptr
- func TestSmhasherAppendedZeros(t *TState) bool
- func TestSmhasherAvalanche(t *TState) bool
- func TestSmhasherCyclic(t *TState) (ret bool)
- func TestSmhasherPermutation(t *TState) bool
- func TestSmhasherSanity(t *TState) (ret bool)
- func TestSmhasherSeed(t *TState) bool
- func TestSmhasherSmallKeys(t *TState) bool
- func TestSmhasherSparse(t *TState) (ret bool)
- func TestSmhasherText(t *TState) bool
- func TestSmhasherTwoNonzero(t *TState) bool
- func TestSmhasherWindowed(t *TState) bool
- func TestSmhasherZeros(t *TState) bool
- type BytesKey
- type HashSet
- type Int32Key
- type Int64Key
- type Key
- type Permutation
- type TState
- type Test
Constants ¶
This section is empty.
Variables ¶
var N = 0
var Permutations = []Permutation{ Permutation{8, []uint32{0, 1, 2, 3, 4, 5, 6, 7}}, Permutation{8, []uint32{0, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}}, Permutation{20, []uint32{0, 1}}, Permutation{20, []uint32{0, 1 << 31}}, Permutation{6, []uint32{0, 1, 2, 3, 4, 5, 6, 7, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}}, }
var Tests = []Test{ Test{TestSmhasherSanity, "TestSmhasherSanity"}, Test{TestSmhasherSeed, "TestSmhasherSeed"}, Test{TestSmhasherText, "TestSmhasherText"}, Test{TestSmhasherWindowed, "TestSmhasherWindowed"}, Test{TestSmhasherAvalanche, "TestSmhasherAvalanche"}, Test{TestSmhasherPermutation, "TestSmhasherPermutation"}, Test{TestSmhasherSparse, "TestSmhasherSparse"}, Test{TestSmhasherCyclic, "TestSmhasherCyclic"}, Test{TestSmhasherTwoNonzero, "TestSmhasherSmallKeys"}, Test{TestSmhasherSmallKeys, "TestSmhasherZeros"}, Test{TestSmhasherAppendedZeros, "TestSmhasherAppendedZeros"}, }
Functions ¶
func BenchmarkHash1024 ¶
func BenchmarkHash1024()
func BenchmarkHash16 ¶
func BenchmarkHash16()
func BenchmarkHash5 ¶
func BenchmarkHash5()
func BenchmarkHash64 ¶
func BenchmarkHash64()
func BenchmarkHash65536 ¶
func BenchmarkHash65536()
func RunSMhasher ¶
func StringHash ¶
func TestSmhasherAppendedZeros ¶
a string plus adding zeros must make distinct hashes
func TestSmhasherAvalanche ¶
Flipping a single bit of a key should flip each output bit with 50% probability.
func TestSmhasherCyclic ¶
Test strings with repeats, like "abcdabcdabcdabcd..."
func TestSmhasherPermutation ¶
Test all possible combinations of n blocks from the set s. "permutation" is a bad name here, but it is what Smhasher uses.
func TestSmhasherSanity ¶
Sanity checks. hash should not depend on values outside key. hash should not depend on alignment.
func TestSmhasherSeed ¶
Make sure different seed values generate different hashes.
func TestSmhasherSmallKeys ¶
All 0-3 byte strings have distinct hashes.
func TestSmhasherSparse ¶
Test strings with only a few bits set
func TestSmhasherText ¶
All keys of the form prefix + [A-Za-z0-9]*N + suffix.
func TestSmhasherTwoNonzero ¶
Strings with up to two nonzero bytes all have distinct hashes.
func TestSmhasherWindowed ¶
All bit rotations of a set of distinct keys
func TestSmhasherZeros ¶
Different length strings of all zeros have distinct hashes.
Types ¶
type Permutation ¶
type Permutation struct {
// contains filtered or unexported fields
}