hashes
nimony/lib/std/hashes.nim
type Hash = uint64Integer type carrying hash values; combine with
!&and finish with!$.type Hashable = concept func hash(a: Self): uint64
func !&(h: uint64; val: uint64): uint64Mixes a hash value
hwithvalto produce a new hash value.func !$(h: uint64): uint64Finishes the computation of the hash value.
func hash(s: string): uint64An inline shim for
system.hashStr. The mix is!&/!$over the chars;hashStrfetches the firstAlwaysAvailof them from thebytesword.func hash(u: uint64): uint64func hash(x: int64): uint64func hash(x: int32): uint64func hash(x: char): uint64func hash(x: bool): uint64func hash(x: float64): uint64func hash(x: float32): uint64func hash(x: T): uint64func hash(x: tuple[A, B]): uint64func hash(x: tuple[A, B, C]): uint64Computes a hash value for
x.func hash(x: seq[T]): uint64Computes a hash value for
x, mixing each element's hash in order.func nextTry`body(h`b: uint64; maxHash`b: int64): uint64Advances a hash probe index inside
0 .. maxHash(linear probing helper).func nextTry(h: uint64; maxHash: int64): uint64Advances a hash probe index inside
0 .. maxHash(linear probing helper).func hashIgnoreStyle(x: string): uint64Efficient hashing of strings; style is ignored.
Note: This uses a different hashing algorithm than
hash(string).See also:
func hashIgnoreStyle`body(sBuf`b: string; sPos`b: int64; ePos`b: int64): uint64Efficient hashing of a string buffer, from starting position
sPosto ending positionePos(included); style is ignored.Note: This uses a different hashing algorithm than
hash(string).hashIgnoreStyle(myBuf, 0, myBuf.high)is equivalent tohashIgnoreStyle(myBuf).func hashIgnoreStyle(sBuf: string; sPos: int64; ePos: int64): uint64Efficient hashing of a string buffer, from starting position
sPosto ending positionePos(included); style is ignored.Note: This uses a different hashing algorithm than
hash(string).hashIgnoreStyle(myBuf, 0, myBuf.high)is equivalent tohashIgnoreStyle(myBuf).func hashIgnoreCase(x: string): uint64Efficient hashing of strings; case is ignored.
Note: This uses a different hashing algorithm than
hash(string).See also:
func hashIgnoreCase`body(sBuf`b: string; sPos`b: int64; ePos`b: int64): uint64Efficient hashing of a string buffer, from starting position
sPosto ending positionePos(included); case is ignored.Note: This uses a different hashing algorithm than
hash(string).hashIgnoreCase(myBuf, 0, myBuf.high)is equivalent tohashIgnoreCase(myBuf).func hashIgnoreCase(sBuf: string; sPos: int64; ePos: int64): uint64Efficient hashing of a string buffer, from starting position
sPosto ending positionePos(included); case is ignored.Note: This uses a different hashing algorithm than
hash(string).hashIgnoreCase(myBuf, 0, myBuf.high)is equivalent tohashIgnoreCase(myBuf).