Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 15-Oct-2021 | - | ||||
v2/ | H | 03-May-2022 | - | 691 | 459 | |
README.md | H A D | 15-Oct-2021 | 1.8 KiB | 51 | 36 | |
go.mod | H A D | 15-Oct-2021 | 146 | 7 | 5 | |
go.sum | H A D | 15-Oct-2021 | 402 | 5 | 4 | |
rotate.go | H A D | 15-Oct-2021 | 643 | 15 | 9 | |
rotate19.go | H A D | 15-Oct-2021 | 563 | 15 | 10 | |
xxhash.go | H A D | 15-Oct-2021 | 3.3 KiB | 169 | 131 | |
xxhash_amd64.go | H A D | 15-Oct-2021 | 206 | 13 | 3 | |
xxhash_amd64.s | H A D | 15-Oct-2021 | 4.1 KiB | 234 | 143 | |
xxhash_other.go | H A D | 15-Oct-2021 | 1.5 KiB | 76 | 59 | |
xxhash_safe.go | H A D | 15-Oct-2021 | 235 | 11 | 4 | |
xxhash_unsafe.go | H A D | 15-Oct-2021 | 906 | 31 | 13 |
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