Skip to content

Commit f5ccc78

Browse files
committed
binary/encode: don't encode lowercase strings as hex
Should fix tulir#666 Closes tulir#738
1 parent faf72d6 commit f5ccc78

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

binary/encoder.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func validateHex(value string) bool {
286286
return false
287287
}
288288
for _, char := range value {
289-
if !(char >= '0' && char <= '9') && !(char >= 'A' && char <= 'F') && !(char >= 'a' && char <= 'f') {
289+
if !(char >= '0' && char <= '9') && !(char >= 'A' && char <= 'F') {
290290
return false
291291
}
292292
}
@@ -299,8 +299,6 @@ func packHex(value byte) byte {
299299
return value - '0'
300300
case value >= 'A' && value <= 'F':
301301
return 10 + value - 'A'
302-
case value >= 'a' && value <= 'f':
303-
return 10 + value - 'a'
304302
case value == 0:
305303
return 15
306304
default:

0 commit comments

Comments
 (0)