fnv
FNV-1 and FNV-1a non-cryptographic hash functions (documentation hosted at: https://ryuk.ooo/nimdocs/fnv/fnv.html)
Summary
| Latest Version | Unknown |
|---|---|
| License | Apache-2.0 |
| CI Status | Passing |
| Downloads | 0 |
| Last Indexed | 2026-07-22 05:28 |
Tags
Installation
nimble install fnv
choosenim install fnv
git clone https://gitlab.com/ryukoposting/nim-fnv
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| fnv | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://gitlab.com/ryukoposting/nim-fnv |
|---|---|
| Homepage | https://gitlab.com/ryukoposting/nim-fnv |
| Documentation | View Documentation |
| Registry Source | nimble_official |
README
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.