mirror of
https://gitlab.com/ryukoposting/nim-fnv
synced 2026-01-02 18:04:40 +00:00
No description
|
|
||
|---|---|---|
| src | ||
| tests | ||
| .gitlab-ci.yml | ||
| ci_init.sh | ||
| fnv.nimble | ||
| README.md | ||
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.