Add back forwarding func to deduplicate doc comments As of Go 1.13 this can be inlined so it doesn't add overhead. Fixes #22.
diff --git a/xxhash.go b/xxhash.go index db0b35f..8f34f5d 100644 --- a/xxhash.go +++ b/xxhash.go
@@ -8,6 +8,9 @@ "math/bits" ) +// Sum64 computes the 64-bit xxHash digest of b. +func Sum64(b []byte) uint64 { return sum64(b) } + const ( prime1 uint64 = 11400714785074694791 prime2 uint64 = 14029467366897019727
diff --git a/xxhash_amd64.go b/xxhash_amd64.go index ad14b80..16df852 100644 --- a/xxhash_amd64.go +++ b/xxhash_amd64.go
@@ -4,10 +4,8 @@ package xxhash -// Sum64 computes the 64-bit xxHash digest of b. -// //go:noescape -func Sum64(b []byte) uint64 +func sum64(b []byte) uint64 //go:noescape func writeBlocks(d *Digest, b []byte) int
diff --git a/xxhash_amd64.s b/xxhash_amd64.s index d580e32..789316d 100644 --- a/xxhash_amd64.s +++ b/xxhash_amd64.s
@@ -38,8 +38,8 @@ IMULQ R13, acc \ ADDQ R15, acc -// func Sum64(b []byte) uint64 -TEXT ·Sum64(SB), NOSPLIT, $0-32 +// func sum64(b []byte) uint64 +TEXT ·sum64(SB), NOSPLIT, $0-32 // Load fixed primes. MOVQ ·prime1v(SB), R13 MOVQ ·prime2v(SB), R14
diff --git a/xxhash_other.go b/xxhash_other.go index 4a5a821..be7cea2 100644 --- a/xxhash_other.go +++ b/xxhash_other.go
@@ -2,8 +2,7 @@ package xxhash -// Sum64 computes the 64-bit xxHash digest of b. -func Sum64(b []byte) uint64 { +func sum64(b []byte) uint64 { // A simpler version would be // d := New() // d.Write(b)