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, raises: [], tags: [].}
-
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, raises: [], tags: [].}
-
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 {.raises: [], tags: [].}
-
hashes an array of bytes of size size
proc hash(x: pointer): THash {.inline, raises: [], tags: [].}
-
efficient hashing of pointers
proc hash[T](x: T): THash {.inline.}
-
efficient hashing of proc vars; closures are supported too.
proc hash(x: int): THash {.inline, raises: [], tags: [].}
-
efficient hashing of integers
proc hash(x: int64): THash {.inline, raises: [], tags: [].}
-
efficient hashing of integers
proc hash(x: char): THash {.inline, raises: [], tags: [].}
-
efficient hashing of characters
proc hash(x: string): THash {.raises: [], tags: [].}
-
efficient hashing of strings
proc hashIgnoreStyle(x: string): THash {.raises: [], tags: [].}
-
efficient hashing of strings; style is ignored
proc hashIgnoreCase(x: string): THash {.raises: [], tags: [].}
-
efficient hashing of strings; case is ignored
proc hash[T](x: T): THash
-
efficient hashing of tuples.
proc hash(x: float): THash {.inline, raises: [], tags: [].}
-
proc hash[A](x: openArray[A]): THash
-