No description
Find a file
ryukoposting 5769537f8e Merge branch 'devel' into 'master'
Merge new test infrastructure

See merge request ryukoposting/nim-fnv!1
2019-03-03 04:13:02 +00:00
src add tests for FNV-1, add 128-bit hash 2019-03-02 14:10:11 -06:00
tests add tests for FNV-1, add 128-bit hash 2019-03-02 14:10:11 -06:00
.gitlab-ci.yml trying custom container 2019-03-02 18:30:50 -06:00
ci_init.sh add ci_init 2019-02-19 20:28:21 -06:00
fnv.nimble add -y to nimble install stint 2019-03-02 14:32:42 -06:00
README.md add README 2019-02-24 15:19:27 -06:00

import fnv

Full documentation is hosted here.

fnv implements the 32- and 64-bit variants of the FNV-1 and FNV-1a hash functions. Using them is simple:

let
  hash1 = fnv1a_64("hello, world!")
  hash2 = fnv1_32(['a', 'r', 'r', 'a', 'y'])
  hash3 = fnv1a_32(@['s', 'e', 'q', 'u', 'e', 'n', 'c', 'e'])

# thanks to style insensitivity, the above is the same as:
let
  hash1 = fnv1a64("hello, world!")
  hash2 = fnv132(['a', 'r', 'r', 'a', 'y'])
  hash3 = fnv1a32(@['s', 'e', 'q', 'u', 'e', 'n', 'c', 'e'])

The functions implemented here should work for anything that can be looped over in a for loop, whose elements can be casted to uint8.