Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
v2/ | H | 03-May-2022 | - | |||
xxhsum/ | H | 10-Sep-2018 | - | |||
README.md | H A D | 10-Sep-2018 | 1.8 KiB | |||
go.mod | H A D | 10-Sep-2018 | 146 | |||
go.sum | H A D | 10-Sep-2018 | 402 | |||
rotate.go | H A D | 10-Sep-2018 | 643 | |||
rotate19.go | H A D | 10-Sep-2018 | 563 | |||
xxhash.go | H A D | 10-Sep-2018 | 3.3 KiB | |||
xxhash_amd64.go | H A D | 10-Sep-2018 | 206 | |||
xxhash_amd64.s | H A D | 10-Sep-2018 | 4.1 KiB | |||
xxhash_amd64_test.go | H A D | 10-Sep-2018 | 1.3 KiB | |||
xxhash_other.go | H A D | 10-Sep-2018 | 1.5 KiB | |||
xxhash_safe.go | H A D | 10-Sep-2018 | 235 | |||
xxhash_test.go | H A D | 10-Sep-2018 | 3.3 KiB | |||
xxhash_unsafe.go | H A D | 10-Sep-2018 | 906 |
README.md
1# xxhash 2 3[![GoDoc](https://godoc.org/github.com/cespare/xxhash?status.svg)](https://godoc.org/github.com/cespare/xxhash) 4 5xxhash is a Go implementation of the 64-bit 6[xxHash](http://cyan4973.github.io/xxHash/) algorithm, XXH64. This is a 7high-quality hashing algorithm that is much faster than anything in the Go 8standard library. 9 10The API is very small, taking its cue from the other hashing packages in the 11standard library: 12 13 $ go doc github.com/cespare/xxhash ! 14 package xxhash // import "github.com/cespare/xxhash" 15 16 Package xxhash implements the 64-bit variant of xxHash (XXH64) as described 17 at http://cyan4973.github.io/xxHash/. 18 19 func New() hash.Hash64 20 func Sum64(b []byte) uint64 21 func Sum64String(s string) uint64 22 23This implementation provides a fast pure-Go implementation and an even faster 24assembly implementation for amd64. 25 26## Benchmarks 27 28Here are some quick benchmarks comparing the pure-Go and assembly 29implementations of Sum64 against another popular Go XXH64 implementation, 30[github.com/OneOfOne/xxhash](https://github.com/OneOfOne/xxhash): 31 32| input size | OneOfOne | cespare (purego) | cespare | 33| --- | --- | --- | --- | 34| 5 B | 416 MB/s | 720 MB/s | 872 MB/s | 35| 100 B | 3980 MB/s | 5013 MB/s | 5252 MB/s | 36| 4 KB | 12727 MB/s | 12999 MB/s | 13026 MB/s | 37| 10 MB | 9879 MB/s | 10775 MB/s | 10913 MB/s | 38 39These numbers were generated with: 40 41``` 42$ go test -benchtime 10s -bench '/OneOfOne,' 43$ go test -tags purego -benchtime 10s -bench '/xxhash,' 44$ go test -benchtime 10s -bench '/xxhash,' 45``` 46 47## Projects using this package 48 49- [InfluxDB](https://github.com/influxdata/influxdb) 50- [Prometheus](https://github.com/prometheus/prometheus) 51