package
module
Version:
v1.2.1
Opens a new window with list of versions in this module.
Published: Feb 7, 2021
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 6
Opens a new window with list of known importers.
README
¶
seahash
A Go port of the SeaHash algorithm.
Benchmarks
Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz running Linux 5.3.0
BenchmarkSeahash64-8 55457641 20.8 ns/op 0 B/op 0 allocs/op
BenchmarkFnvHash32-8 40879219 30.2 ns/op 4 B/op 1 allocs/op
BenchmarkFnvHash64-8 34940972 30.6 ns/op 8 B/op 1 allocs/op
BenchmarkFarmHashHash32-8 61766998 19.3 ns/op 0 B/op 0 allocs/op
BenchmarkFarmHashHash64-8 100000000 11.6 ns/op 0 B/op 0 allocs/op
BenchmarkHuichenMurmur-8 81137569 13.6 ns/op 0 B/op 0 allocs/op
BenchmarkReuseeMurmur-8 21982393 52.7 ns/op 4 B/op 1 allocs/op
BenchmarkZhangMurmur-8 91060291 14.1 ns/op 0 B/op 0 allocs/op
BenchmarkDgryskiSpooky32-8 44230748 27.9 ns/op 0 B/op 0 allocs/op
BenchmarkDgryskiSpooky64-8 48947028 23.9 ns/op 0 B/op 0 allocs/op
BenchmarkDgryskiStatdx64-8 100000000 11.5 ns/op 0 B/op 0 allocs/op
BenchmarkHashlandSpooky32-8 40680852 29.5 ns/op 0 B/op 0 allocs/op
BenchmarkHashlandSpooky64-8 43915500 28.0 ns/op 0 B/op 0 allocs/op
BenchmarkCreachadairCity32-8 39462910 28.9 ns/op 0 B/op 0 allocs/op
BenchmarkCreachadairCity64-8 80871393 15.4 ns/op 0 B/op 0 allocs/op
Documentation
¶
View Source
const BlockSize = 8
BlockSize of SeaHash in bytes.
View Source
const Size = 8
Size of a SeaHash checksum in bytes.
Sum is a convenience method that returns the checksum of the byte slice
// hash some bytes
hash := Sum([]byte("to be or not to be"))
fmt.Printf("%x", hash)
Output:
75e54a6f823a991b
Sum64 is a convenience method that returns uint64 checksum of the byte slice
// hash some bytes
fmt.Printf("%x", Sum64([]byte("to be or not to be")))
Output:
1b993a826f4ae575
New creates a new SeaHash hash.Hash64
// hash some bytes
h := New()
h.Write([]byte("to be or not to be"))
hash := h.Sum64()
fmt.Printf("%x", hash)
Output:
1b993a826f4ae575
BlockSize returns BlockSize constant to satisfy hash.Hash interface
Size returns Size constant to satisfy hash.Hash interface
Source Files
¶
Click to show internal directories.
Click to hide internal directories.