Skip to content

Commit

Permalink
hash limbs instead of bytes (#155)
Browse files Browse the repository at this point in the history
avoids silly byte hasher
  • Loading branch information
arnetheduck authored Jun 17, 2024
1 parent 9d2b382 commit 9a3348b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions stint/io.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.}

Expand Down

0 comments on commit 9a3348b

Please sign in to comment.