Package Exports
- commonform-hash
- commonform-hash/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (commonform-hash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
commonform-hash
cryptographically hash Common Forms
This package wraps different implementations of SHA-256, one for the browser, via browserify, and the other for Node.js, via the core crypto module.
var hash = require('commonform-hash')
var assert = require('assert')
assert.strictEqual(
hash({ content: [ 'This is a form.' ] }),
'0cb94c21d8e303ae4785e9433afe33132b4fe76275ae96d9b2d0b10a6fdf716a'
)
assert.strictEqual(
hash({ conspicuous: 'yes', content: [ 'This is a form.' ] }),
'76b69d4004186e35b26fb816835a92de5cfa8b1e553e45516b878bb3d35187d5'
)
assert.strictEqual(
hash({ content: [ 'This is a form.' ], conspicuous: 'yes' }),
'76b69d4004186e35b26fb816835a92de5cfa8b1e553e45516b878bb3d35187d5'
)