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 Word
template hash*(num: StUint|StInt): Hash = template hash*(num: StUint|StInt): Hash =
# TODO: mixin limbs
# `hashData` is not particularly efficient. hash(num.limbs)
# Explore better hashing solutions in nim-stew.
hashData(unsafeAddr num, sizeof num)
{.pop.} {.pop.}