From 4e9a857b90c3c17271bfc033570605be99de6b93 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Thu, 18 Feb 2021 16:27:00 +0200 Subject: [PATCH] Link to original procedure for hexValue(). --- chronos/streams/chunkstream.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chronos/streams/chunkstream.nim b/chronos/streams/chunkstream.nim index 5e36b83..d5f439e 100644 --- a/chronos/streams/chunkstream.nim +++ b/chronos/streams/chunkstream.nim @@ -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