Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/behnammodi/object-hash-light
Generate hashes from objects and values in modern browser
https://github.com/behnammodi/object-hash-light
Last synced: about 1 month ago
JSON representation
Generate hashes from objects and values in modern browser
- Host: GitHub
- URL: https://github.com/behnammodi/object-hash-light
- Owner: behnammodi
- Created: 2021-08-20T20:21:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-28T19:54:16.000Z (about 3 years ago)
- Last Synced: 2024-05-27T12:33:21.652Z (6 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# object-hash-light
Generate hashes from objects and values in modern browser, node and deno
| Node | Deno | Chrome | Firefox | Opera | Safari |
| ---- | ---- | ------ | ------- | ----- | ------ |
| 15 | 1.11 | 37 | 34 | 24 | 7 |\* Android Chrome, Firefox and iOS Safari support version is same with Desktop version
Less than < 300 Bytes [bundlephobia](https://bundlephobia.com/package/object-hash-light)
# install
```bash
npm i object-hash-light
```# usage
```js
import hash from "object-hash-light";const result = await hash({ foo: "bar" });
// result is a5e744d0164540d33b1d7ea616c28f2fa97e754a
```# algorithms
SHA-1 (default), SHA-256, SHA-384, SHA-512
```js
const result = await hash({ foo: "bar" }, { algorithm: "SHA-512" });
// result is 0db68ad4e41d3b26ba3fc48a5da7c9f616b813e77cb4e951187e1f2a37c2bad94041089f89f6012ee7b44e21f863c5d9553e3b665edae8640bb2274b555266eb
```