Skip to content

anchorjs/crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anchor/Crypto

The Crypto module provides support for cryptographic operations.

Install

component
$ component install anchorjs/crypto
volo
$ volo add anchorjs/crypto

Usage

Hash

Create hash digests of data.

var md5sum = crypto.createHash('md5');
md5sum.update('Hello');
md5sum.update('World');
var d = md5sum.digest('hex');

Hmac

Create cryptographic hmac content.

var md5hmac = crypto.createHmac('md5', 'key');
md5hmac.update('Hello');
md5hmac.update('World');
var d = md5hmac.digest('hex');

Compatibility

component

This module uses the AMD format. To include in component builds, use component-amd:

component build -u component-amd
Node

This module (partially) conforms to the interface exported by Node's Crypto module.

Tests

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

Credits

License

The MIT License

Copyright (c) 2012-2013 Jared Hanson <http://jaredhanson.net/>