Node-crc32c
Basic C modules for NodeJS with crc32c (Castagnoli) implementation for Linux. The implementation uses the native Linux library "AF_ALG".
This module is not meant for secure hashing but really for something like ETags or anything that is easier to compare using a hash than the full string.
##Building
node-gyp configure build
or
npm install crc32c
##Usage
For small number of computation needed
From JavaScript:
var crc32c = require('crc32c');
var toHash = "HELLOWORLD";
console.log(crc32c.compute(toHash));
console.log(crc32c.compute(new Buffer('{"jsonString":"property1","jsonArray":["arr1","arr2","arr3"]}')));
For batch computing
With >100 iterations I get a 3x perf improvements. It really shows up at more than 10K iterations though.
From JavaScript:
var crc32c = require('crc32c');
var Batcher = new crc32c.Batcher();
var Batcher.openSocket();
console.log(Batcher.compute(new Buffer('{"jsonString":"property1","jsonArray":["arr1","arr2","arr3"]}')));
Batcher.closeSocket();
From cli:
crc32c <filename>
It currently supports only one file at the time.
##License
The plugin is under MIT license, please see the LICENSE file provided with the module.