We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67a137d commit 3272ef2Copy full SHA for 3272ef2
bswap/swap64.go
@@ -2,10 +2,14 @@ package bswap
2
3
import _ "github.com/segmentio/asm/cpu"
4
5
-// Swap64 performs an in-place byte swap on each qword of the input buffer.
+// Swap64 performs an in-place byte swap on each 64 bits elements in b.
6
+//
7
+// This function is useful when dealing with big-endian input; by converting it
8
+// to little-endian, the data can then be compared using native CPU instructions
9
+// instead of having to employ often slower byte comparison algorithms.
10
func Swap64(b []byte) {
11
if len(b)%8 != 0 {
- panic("swap64 expects full qwords")
12
+ panic("swap64 expects the input to contain full 64 bits elements")
13
}
14
swap64(b)
15
0 commit comments