Update encoding_test.go

This commit is contained in:
0xFloki 2025-12-21 19:28:42 +01:00 committed by GitHub
parent 2e5cd21edf
commit 4b1df3145b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,7 +99,7 @@ func TestHexToCompactInPlaceRandom(t *testing.T) {
key := make([]byte, l)
crand.Read(key)
hexBytes := keybytesToHex(key)
hexOrig := []byte(string(hexBytes))
hexOrig := append([]byte(nil), hexBytes...) // copy without extra string alloc
exp := hexToCompact(hexBytes)
got := hexToCompactInPlace(hexBytes)