# json-hash

> Compute JSON hash.

Latest version **1.2.0** (published 2016-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-hash
pnpm add json-hash
yarn add json-hash
bun add json-hash
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2016-07-07 |
| First published | 2014-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Mirek Rusin http://github.com/mirek |
| Maintainers | mirek |
| Keywords | json, hash, hashing, compare, objects, difference, different, same, deep, deepEqual, sha, sha1, sha256, array, object, browserify |

## Links

- npm: https://www.npmjs.com/package/json-hash
- Repository: https://github.com/mirek/node-json-hash
- Issues: https://github.com/mirek/node-json-hash/issues
- npm.io page: https://npm.io/package/json-hash

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.0 (latest) — 2016-07-07
- 1.1.0 — 2015-03-27
- 1.0.1 — 2015-03-27
- 1.0.0 — 2015-03-27
- 0.0.4 — 2014-05-26
- 0.0.3 — 2014-05-19
- 0.0.2 — 2014-03-18
- 0.0.1 — 2014-03-18
- 0.0.0 — 2014-03-18

## 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.

---
_Source: https://npm.io/package/json-hash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
