fnv
Version, currently 0.1.23 versions
- 0.1.3latestMar 24, 2021
- 0.1.2not indexedMar 24, 2021
- 0.1.1not indexedMar 24, 2021
github.com/naqvis/crystal-fnv
Crystal Implementation of Fowler–Noll–Vo hash
Nothing has been indexed for 0.1.2 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
fnv:
github: naqvis/crystal-fnv
version: ~> 0.1.2Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.2. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
Crystal-FNV
Implements 32, 64 and 128 bits FNV-1 and FNV-1a Fowler–Noll–Vo hash function. FNV is a non-cryptographic hash function created by Glenn Fowler, Landon Curt Noll, and Phong Vo. Refer to Wikipedia for more details.
Installation
-
Add the dependency to your
shard.yml:dependencies: fnv: github: naqvis/crystal-fnv -
Run
shards install
Usage
require "fnv"
# 32bit FNV-1
digest = Digest::FNV32.digest("foo")
p IO::ByteFormat::BigEndian.decode(UInt32, digest) # => 1083137555
# 32bit FNV-1a
digest = Digest::FNV32A.digest("foo")
p IO::ByteFormat::BigEndian.decode(UInt32, digest) # => 2851307223
# 64bit FNV-1
digest = Digest::FNV64.digest("foo")
p IO::ByteFormat::BigEndian.decode(UInt64, digest) # => 15621798640163566899
# 64bit FNV-1a
digest = Digest::FNV64A.digest("foo")
p IO::ByteFormat::BigEndian.decode(UInt64, digest) # => 15902901984413996407
# 128bit FNV-1
digest = Digest::FNV128.digest("foo")
p IO::ByteFormat::BigEndian.decode(UInt128, digest) # => 221377198890555750482995053501755142603
# 128bit FNV-1a
digest = Digest::FNV128A.digest("foo")
p IO::ByteFormat::BigEndian.decode(UInt128, digest) # => 221385884292107687162785618921601726655
Contributing
- Fork it (https://github.com/naqvis/crystal-fnv/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Ali Naqvi - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.2- Tagged
- Mar 24, 2021
- Commit
8cd2255cda84- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/naqvis/crystal-fnv
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 3