hash limbs instead of bytes (#155)

avoids silly byte hasher
This commit is contained in:
Jacek Sieka 2024-06-17 15:40:09 +02:00 committed by GitHub
parent 9d2b382c5d
commit 9a3348bd44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -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.}