characterhash

Character Hashing based on given value type and input type. Uses Nim's random Module to generate initial randomized hash value, and has an option to be given seeds. For more info regarding the random please refer to xoroshiro128+(xor/rotate/shift/rotate) library

... _library:https://nim-lang.org/docs/random.html

Types

Units = uint8 | uint16 | uint32 | uint64
CharacterHash[H; C] = object
  hashValues*: seq[H]

Procs

proc maskFnc[H](bits: int): H {...}{.inline.}

Return a mask of ones equal to bits (eg: 4 bit mask = 0b1111)

Asserts that 0 < bits <= sizeof(type) in bits

proc hash[H, C](maxVal: H): CharacterHash[H, C] {...}{.raises: [IOError], inline.}
Based on bitsize of required hash, will return a quasi-random (sequence always the same since randomize is not called) range between 0..maxVal
proc hash[H, C](maxVal: H; seedOne, seedTwo: int): CharacterHash[H, C] {...}{.
    raises: [IOError], inline.}
Based on bitsize of required hash, will return a random number between the range of 0..maxVal. Randomization is based upon the seeds given.