Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mirek/node-json-hash
JSON hash
https://github.com/mirek/node-json-hash
Last synced: about 1 month ago
JSON representation
JSON hash
- Host: GitHub
- URL: https://github.com/mirek/node-json-hash
- Owner: mirek
- Created: 2014-03-18T11:44:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-07-07T17:21:30.000Z (over 8 years ago)
- Last Synced: 2024-11-13T01:51:38.578Z (about 1 month ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 24
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Summary
Generates hash for JSON objects.
## Usage
// If you're not on babel use:
// require('babel/polyfill')npm install json-hash
var assert = require('assert')
var hash = require('json-hash')// hash.digest(any, options?)
assert.equal(hash.digest({foo:1,bar:1}), hash.digest({bar:1,foo:1}))We're compatible with browserify by using a JavaScript implementation of SHA1.
If you want to use nodejs one, pass `hash.digest(foo, { crypto: require('crypto') })`.
## Changes
* 2.0.0 - defaults to internal js implementation of sha1, pass { crypto: require('crypto') } to use nodejs one.