File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ package xxhash
33func u32 (in []byte ) uint32 {
44 return uint32 (in [0 ]) | uint32 (in [1 ])<< 8 | uint32 (in [2 ])<< 16 | uint32 (in [3 ])<< 24
55}
6+ func u64 (in []byte ) uint64 {
7+ return uint64 (in [0 ]) | uint64 (in [1 ])<< 8 | uint64 (in [2 ])<< 16 | uint64 (in [3 ])<< 24 | uint64 (in [4 ])<< 32 | uint64 (in [5 ])<< 40 | uint64 (in [6 ])<< 48 | uint64 (in [7 ])<< 56
8+ }
69
710// Checksum32S returns the checksum of the input bytes with the specific seed.
811func Checksum32S (in []byte , seed uint32 ) (h uint32 ) {
Original file line number Diff line number Diff line change @@ -167,14 +167,14 @@ func BenchmarkXXSum64EvenPoint(b *testing.B) {
167167 b .SkipNow ()
168168 }
169169
170- for j := 256 ; j < len (in ); j += 256 {
171- block := in [:j ]
172- b .Run ("Func/" + strconv .Itoa (j ), func (b * testing.B ) {
170+ for i := 256 ; i < len (in ); i += 256 {
171+ block := in [:i ]
172+ b .Run ("Func/" + strconv .Itoa (i ), func (b * testing.B ) {
173173 for i := 0 ; i < b .N ; i ++ {
174174 xxhash .Checksum64 (block )
175175 }
176176 })
177- b .Run ("Struct/" + strconv .Itoa (j ), func (b * testing.B ) {
177+ b .Run ("Struct/" + strconv .Itoa (i ), func (b * testing.B ) {
178178 h := xxhash .New64 ()
179179 for i := 0 ; i < b .N ; i ++ {
180180 h .Write (block )
You can’t perform that action at this time.
0 commit comments