Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An xxhash binding for node.js

tag: v0.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

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.

Something went wrong with that request. Please try again.