added hash for uints (#5435)
This commit is contained in:
parent
f250c30b9d
commit
5774145f5d
2 changed files with 23 additions and 0 deletions
|
|
@ -112,6 +112,14 @@ proc hash*(x: int64): Hash {.inline.} =
|
|||
## efficient hashing of int64 integers
|
||||
result = toU32(x)
|
||||
|
||||
proc hash*(x: uint): Hash {.inline.} =
|
||||
## efficient hashing of unsigned integers
|
||||
result = cast[int](x)
|
||||
|
||||
proc hash*(x: uint64): Hash {.inline.} =
|
||||
## efficient hashing of uint64 integers
|
||||
result = toU32(cast[int](x))
|
||||
|
||||
proc hash*(x: char): Hash {.inline.} =
|
||||
## efficient hashing of characters
|
||||
result = ord(x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue