get the shasum of a buffer or object
npm install shasum-objectGet the shasum of a buffer or object.
Description - Install - Usage - License: Apache-2.0
[![npm][npm-image]][npm-url]
[![actions][actions-image]][actions-url]
[![standard][standard-image]][standard-url]
[npm-image]: https://img.shields.io/npm/v/shasum-object.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/shasum-object
[actions-image]: https://img.shields.io/github/actions/workflow/status/goto-bus-stop/shasum-object/ci.yml
[actions-url]: https://github.com/goto-bus-stop/shasum-object/actions/workflows/ci.yml
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard
shasum-object computes a hash string for strings, buffers, and JSON objects.
Sha1 is used by default, but other algorithms provided by Node.js are supported.
shasum-object is committed to supporting all Node.js versions 0.8 and up.
This is a spiritual successor to shasum.
```
npm install shasum-object
`js
var fs = require('fs')
var shasum = require('shasum-object')
shasum('of a string')
shasum(fs.readFileSync('of-a-file.txt'))
shasum({
of: ['an', 'object']
})
`
Compute the hash for the given input.
- input - a string, buffer or JSON object. objects are stringified using fast-safe-stringify.algorithm
- - the hash algorithm to use. see crypto.createHash.encoding
- - how to encode the hash result. see hash.digest`.