hashf

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HashFunctions = map[string]HashFunction{
	"nullhash":      HashFunction{"nullhash", 64, true, "nullhash, 64 bit", &DispEntry{fp: unsafe.Pointer(&fnull), kind: h64s}},
	"nullhashF64ns": HashFunction{"nullhashF64ns", 64, true, "nullhashF64ns, 64 bit, no seed", nil},
	"aeshash64":     HashFunction{"aeshash64", 64, true, "aeshash, 64 bit, accelerated", &DispEntry{fp: unsafe.Pointer(&faes), kind: h64s}},
	"siphash64":     HashFunction{"siphash64", 64, true, "siphash, 64 bit, accelerated", nil},
	"siphash64pg":   HashFunction{"siphash64pg", 64, true, "siphash, pure go, 64 bit, a bits", nil},

	"MaHash8v64": HashFunction{"MaHash8v64", 64, false, "russian hash function", nil},

	"spooky32":     HashFunction{"spooky32", 32, false, "jenkins, spooky, 32 bit", nil},
	"spooky64":     HashFunction{"spooky64", 64, false, "jenkins, spooky, 64 bit", nil},
	"spooky128h":   HashFunction{"spooky128h", 64, false, "jenkins, spooky, 128 bit, high bits", nil},
	"spooky128l":   HashFunction{"spooky128l", 64, false, "jenkins, spooky, 128 bit, low bits", nil},
	"spooky128xor": HashFunction{"spooky128xor", 64, false, "jenkins, spooky, 128, high xor low bits", nil},
	"j364":         HashFunction{"j364", 64, false, "jenkins, lookup3. 64 bit, c low order bits, b high order bits", nil},
	"j264":         HashFunction{"j264", 64, false, "jenkins, lookup8. 64 bit", nil},
	"j332c":        HashFunction{"j332c", 32, false, "jenkins, lookup3, 32 bit, c bits", nil},
	"j332b":        HashFunction{"j332b", 32, false, "jenkins, lookup3, 32 bit, b bits", nil},
	"j232":         HashFunction{"j232", 32, false, "jenkins, lookup8, 32 bit", nil},
	"j264l":        HashFunction{"j264l", 32, false, "jenkins, lookup8, 64 bit, low bits", nil},
	"j264h":        HashFunction{"j264h", 32, false, "jenkins, lookup8, 64 bit, high bits", nil},
	"j264xor":      HashFunction{"j264xor", 32, false, "jenkins, lookup8, 64 bit, high xor low bits", nil},
	"sbox":         HashFunction{"sbox", 32, false, "sbox", nil},

	"gomap32": HashFunction{"gomap32", 32, false, "gomap32", nil},
	"gomap64": HashFunction{"gomap64", 64, false, "gomap64", &DispEntry{fp: unsafe.Pointer(&fgomap), kind: h64s}},

	"murmur332": HashFunction{"murmur332", 32, false, "murmur332", nil},
	"murmur364": HashFunction{"murmur364", 64, false, "murmur364", nil},

	"FarmHash32":  HashFunction{"FarmHash32", 32, false, "FarmHash32", nil},
	"FarmHash64":  HashFunction{"FarmHash64", 64, false, "FarmHash64", nil},
	"FarmHash128": HashFunction{"FarmHash128", 128, false, "FarmHash128", nil},

	"MetroHash64-1":  HashFunction{"MetroHash64-1", 64, false, "MetroHash64-1", nil},
	"MetroHash64-2":  HashFunction{"MetroHash64-2", 64, false, "MetroHash64-2", nil},
	"MetroHash128-1": HashFunction{"MetroHash128-1", 128, false, "MetroHash128-1", nil},
	"MetroHash128-2": HashFunction{"MetroHash128-2", 128, false, "MetroHash128-2", nil},

	"keccak224":   HashFunction{"keccak224", 64, true, "keccak, 224 bit to 64 bit", nil},
	"keccakpg643": HashFunction{"keccak643", 64, true, "keccak, 64 bit, 3 rounds", nil},
	"keccakpg644": HashFunction{"keccak644", 64, true, "keccak, 64 bit, 4 rounds", nil},
	"keccakpg648": HashFunction{"keccak648", 64, true, "keccak, 64 bit, 8 rounds", nil},
	"skein256":    HashFunction{"skein256", 64, true, "skein256, 64 bit , low 64 bits", nil},
	"sha1":        HashFunction{"sha1", 64, true, "sha1, 160 bit hash", nil},
	"keccak160":   HashFunction{"keccak160", 64, true, "keccak160l", nil},

	"skein256low": HashFunction{"skein256low", 32, true, "skein256low", nil},
	"skein256hi":  HashFunction{"skein256hi", 32, true, "skein256hi", nil},
	"skein256xor": HashFunction{"skein256xor", 32, true, "skein256xor", nil},

	"CrapWow": HashFunction{"CrapWow", 32, false, "CrapWow", nil},
	"adler32": HashFunction{"adler32", 32, false, "adler32", nil},
}
View Source
var Hf2 string // wow this has to go
View Source
var TestHashFunctions = []string{"nullhash",
	"aeshash64", "gomap64", "j364", "j264", "murmur364",
	"siphash64",
	"siphash64pg",
	"MaHash8v64", "spooky64", "spooky128h", "spooky128l", "spooky128xor",
	"murmur332", "j332c", "j332b", "j232", "j264l", "j264h", "j264xor", "spooky32", "sbox", "gomap32",
	"FarmHash32",
	"FarmHash64",
	"FarmHash128-low", "FarmHash128-high", "FarmHash128-xor",
	"MetroHash128-2l", "MetroHash128-2h", "MetroHash128-2xor",
	"MetroHash64-1", "MetroHash64-2",
	"MetroHash128-1l", "MetroHash128-1h", "MetroHash128-1xor",
	"MetroHash128-2l", "MetroHash128-2h", "MetroHash128-2xor",
	"sha1", "keccakpg643", "keccak224", "skein256",
}

"CrapWow" removed because it generates so many dup hashes with duplicated words it goes from O(1) to O(N) "adler32" removed for the same reasons

"siphash64al", "siphash64ah", "siphash64bl", "siphash64bh",
"skein256xor", "skein256low", "skein256hi", "sha1", "keccak160l",
"siphash64", "siphash128a", "siphash128b",
"keccak644", "keccak648" "keccak160",

Functions

func Halloc

func Halloc(hfs string) (hf32 nhash.HashF32)

func Hashf

func Hashf(k []byte, seed uint64) uint64

Types

type DispEntry

type DispEntry struct {
	// contains filtered or unexported fields
}

type HashFunction

type HashFunction struct {
	Name   string
	Size   int // in bits
	Crypto bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL