We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d51208 commit c16fce9Copy full SHA for c16fce9
common/bitutil/bitutil.go
@@ -8,6 +8,7 @@
8
package bitutil
9
10
import (
11
+ "crypto/subtle"
12
"runtime"
13
"unsafe"
14
)
@@ -18,10 +19,7 @@ const supportsUnaligned = runtime.GOARCH == "386" || runtime.GOARCH == "amd64" |
18
19
// XORBytes xors the bytes in a and b. The destination is assumed to have enough
20
// space. Returns the number of bytes xor'd.
21
func XORBytes(dst, a, b []byte) int {
- if supportsUnaligned {
22
- return fastXORBytes(dst, a, b)
23
- }
24
- return safeXORBytes(dst, a, b)
+ return subtle.XORBytes(dst, a, b)
25
}
26
27
// fastXORBytes xors in bulk. It only works on architectures that support
0 commit comments