Correcting a bug in the hex decoder
@@ -152,18 +152,18 @@ var HexToNum = Fn.new {|hex|
if (48 <= first && first <= 57) {
first = first - 48
} else if (65 <= first && first <= 70) {
- first = 9 + first - 65
+ first = 10 + first - 65
} else if (97 <= first && first <= 102) {
- first = 9 + first - 97
+ first = 10 + first - 97
} else {
Fiber.abort("Invalid hex")
}
if (48 <= second && second <= 57) {
second = second - 48
} else if (65 <= second && second <= 70) {
- second = 9 + second - 65
+ second = 10 + second - 65
} else if (97 <= second && second <= 102) {
- second = 9 + second - 97
+ second = 10 + second - 97
} else {
Fiber.abort("Invalid hex")
}
