# get-obj-hash

> Get the hash of a object or primitive using BLAKE2b or BLAKE2s

Latest version **1.0.0** (published 2019-02-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-obj-hash
pnpm add get-obj-hash
yarn add get-obj-hash
bun add get-obj-hash
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-02-14 |
| First published | 2019-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tiaan du Plesssis |
| Maintainers | tiaanduplessis |

## Links

- npm: https://www.npmjs.com/package/get-obj-hash
- Repository: https://github.com/tiaanduplessis/get-obj-hash
- npm.io page: https://npm.io/package/get-obj-hash

## Dependencies (3)

- [blakejs](https://npm.io/package/blakejs.md) ^1.1.0
- [nova-is-obj](https://npm.io/package/nova-is-obj.md) ^1.0.0
- [fast-stringify](https://npm.io/package/fast-stringify.md) ^1.1.1

## Recent versions

- 1.0.0 (latest) — 2019-02-14

## README

# get-obj-hash
[![package version](https://img.shields.io/npm/v/get-obj-hash.svg?style=flat-square)](https://npmjs.org/package/get-obj-hash)
[![package downloads](https://img.shields.io/npm/dm/get-obj-hash.svg?style=flat-square)](https://npmjs.org/package/get-obj-hash)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![package license](https://img.shields.io/npm/l/get-obj-hash.svg?style=flat-square)](https://npmjs.org/package/get-obj-hash)
[![make a pull request](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

> Get the hash of a object or primitive using BLAKE2b or BLAKE2s

## Table of Contents

- [get-obj-hash](#get-obj-hash)
    - [Table of Contents](#table-of-contents)
    - [Install](#install)
    - [Usage](#usage)
    - [Contribute](#contribute)
    - [License](#license)

## Install

This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com). 

```sh
$ npm install get-obj-hash
$ # OR
$ yarn add get-obj-hash
```

## Usage

```js
import getObjHash from 'get-obj-hash'

console.log(getObjHash({ foo: 'bar' }, 'blake2bHex')) // 69ba2f27abe30569cdccad25b58ec54899e77032f765d703a1cd5adcb5dd1158e999ba8325d9c770bff17ae175c220842196a83441a8a146e7bfdc9309955ae6
console.log(getObjHash({foo: 'bar'})) // 09da64c8bf2f8d35f455427593f1cec83a2f5dc297b9bfe9564cd405cd8eedf7
console.log(getObjHash(5)) // 9019e532fa6da4ab4ae2980b2102d79af81e5ccb481bdd6a3c9cdc0f10fe60ee
console.log(getObjHash(true)) // 3aa997a5c6f560fe2ccb5bad11d985987a18bffe9b3b17524cb47a37f4a3bd14
```

Also useful for [keys in React](https://reactjs.org/docs/lists-and-keys.html#keys):

```js
import React from 'react'
import getObjHash from 'get-obj-hash'

const Example = ({listOfObjects}) => 
    listOfObjects.map(current => 
        <div key={getObjHash(current)}>{current.name}</div>)

```

## Contribute

1. Fork it and create your feature branch: `git checkout -b my-new-feature`
2. Commit your changes: `git commit -am "Add some feature"`
3. Push to the branch: `git push origin my-new-feature`
4. Submit a pull request

## License

MIT

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