The Crypto module provides support for cryptographic operations.
$ component install anchorjs/crypto
$ volo add anchorjs/crypto
Create hash digests of data.
var md5sum = crypto.createHash('md5');
md5sum.update('Hello');
md5sum.update('World');
var d = md5sum.digest('hex');
Create cryptographic hmac content.
var md5hmac = crypto.createHmac('md5', 'key');
md5hmac.update('Hello');
md5hmac.update('World');
var d = md5hmac.digest('hex');
This module uses the AMD format. To include in component builds, use component-amd:
component build -u component-amd
This module (partially) conforms to the interface exported by Node's Crypto module.
To run tests in a browser, execute the Make target for the desired browser:
$ make test-chrome
$ make test-firefox
$ make test-safari
Headless tests can be executed directly from a terminal:
$ make test-phantomjs
Copyright (c) 2012-2013 Jared Hanson <http://jaredhanson.net/>