fnv32
v0.0.1
Published
FNV (Fowler–Noll–Vo) 32 bit hash function - FNV-1, FNV-1a.
Downloads
794
Maintainers
Readme
fnv32
FNV (Fowler–Noll–Vo) 32 bit hash function: FNV-1, FNV-1a.
References: https://tools.ietf.org/html/draft-eastlake-fnv-12, https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
Installation
npm install fnv32
Example
const fnv32 = require('fnv32');
var hashed = fnv32.fnv_1a( 'hello' ); // input Buffer or String.
console.log('hashed number: ' + hashed); // unsigned 32 bit integer.
// functions: .fnv_1( Buffer|String ), .fnv_1a( Buffer|String ), .toBufferLE( Number )
Test
npm test
License
Choose either: MIT or Apache 2.0.