An xxhash binding for node.js
Switch branches/tags
Nothing to show
Pull request Compare This branch is 41 commits behind mscdex:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
deps/xxhash
README.md
binding.gyp
hash.cc
index.js
package.json

README.md

Description

An xxhash binding for node.js.

Requirements

License

BSD 2-Clause

Install

npm install xxhash

Examples

  • Hash a file using the fast method:
  var xxhash = require('xxhash'),
        fs = require('fs');

  var file = fs.readFileSync('somefile'),
        result = xxhash.fast(file, 0xCAFEBABE);
  • Hash a file using the strong method:
  var xxhash = require('xxhash'),
        fs = require('fs');

  var file = fs.readFileSync('somefile'),
        result = xxhash.strong(file, 0xCAFEBABE);

API

Static Methods

  • fast(<Buffer>data, <Integer>seed) - <Integer> - Hashes data with the given seed using the fast version of xxhash. The resulting hash is returned.

  • strong(<Buffer>data, <Integer>seed) - <Integer> - Hashes data with the given seed using the strong version of xxhash. The resulting hash is returned.