From 9a3348bd4499045fb211afeeaf2a54730060c081 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Mon, 17 Jun 2024 15:40:09 +0200 Subject: [PATCH] hash limbs instead of bytes (#155) avoids silly byte hasher --- stint/io.nim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stint/io.nim b/stint/io.nim index 992da71..4f74001 100644 --- a/stint/io.nim +++ b/stint/io.nim @@ -35,10 +35,8 @@ template wordType*(_: type SomeBigInteger): type = Word template hash*(num: StUint|StInt): Hash = - # TODO: - # `hashData` is not particularly efficient. - # Explore better hashing solutions in nim-stew. - hashData(unsafeAddr num, sizeof num) + mixin limbs + hash(num.limbs) {.pop.}