node package manager


Fowler–Noll–Vo hash implementation (FNV-1a 32-bit)


Fowler–Noll–Vo (FNV-1a 32-bit) hash implementation for node.js

npm install fnv
var FNV = require("fnv").FNV
var h = new FNV()
h.digest("hex") // 'bf9cf968'

Create a new FNV hash object.

  • data Buffer or String (UTF-8 encoded)

Updates the hash content with the given data. This can be called many times with new data.

  • encoding String - can be 'hex', 'binary' or 'base64'

Returns the digest of all of the passed data to be hashed. If no encoding is provided 'binary' is used.

Returns the hash value as Number