Link to original procedure for hexValue().

This commit is contained in:
cheatfate 2021-02-18 16:27:00 +02:00 committed by zah
parent 1d49ae7a47
commit 4e9a857b90
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,8 @@ proc LT(x, y: uint32): uint32 {.inline.} =
(z xor ((y xor x) and (y xor z))) shr 31
proc hexValue(c: byte): int =
# This is nim adaptation of
# https://github.com/pornin/CTTK/blob/master/src/hex.c#L28-L52
let x = uint32(c) - 0x30'u32
let y = uint32(c) - 0x41'u32
let z = uint32(c) - 0x61'u32