fnv

FNV-1 and FNV-1a non-cryptographic hash functions (documentation hosted at: http://ryuk.ooo/nimdocs/fnv/fnv.html)

Pure Nim score 30/100 · tests present · docs generated

Summary

Latest Version 0.1.0
License Apache-2.0
CI Status Failing
Downloads 0
Last Indexed 2026-09-03 07:22

Authors

  • ryukoposting

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 - - - - - - -

Dependencies

Package Version Optional
nim >= 0.19.0 No
stint - No

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.