This module implements efficient computations of hash values for diverse Nimrod types.
THash* = int
-
a hash value; hash tables using these values should always have a size of a power of two and can use the and operator instead of mod for truncation of the hash value.
proc `!&`*(h: THash; val: int): THash {.inline.}
-
mixes a hash value h with val to produce a new hash value. This is only needed if you need to implement a hash proc for a new datatype.
proc `!$`*(h: THash): THash {.inline.}
-
finishes the computation of the hash value. This is only needed if you need to implement a hash proc for a new datatype.
proc hashData*(Data: Pointer; Size: int): THash
-
hashes an array of bytes of size size
proc hash*(x: Pointer): THash {.inline.}
-
efficient hashing of pointers
proc hash*[T: proc](x: T): THash {.inline.}
-
efficient hashing of proc vars; closures are supported too.
proc hash*(x: int): THash {.inline.}
-
efficient hashing of integers
proc hash*(x: int64): THash {.inline.}
-
efficient hashing of integers
proc hash*(x: char): THash {.inline.}
-
efficient hashing of characters
proc hash*(x: string): THash
-
efficient hashing of strings
proc hashIgnoreStyle*(x: string): THash
-
efficient hashing of strings; style is ignored
proc hashIgnoreCase*(x: string): THash
-
efficient hashing of strings; case is ignored
proc hash*[T: tuple](x: T): THash
-
efficient hashing of tuples.
proc hash*(x: float): THash {.inline.}
-