Package Exports
- shasum-object
- shasum-object/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shasum-object) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
shasum-object
Get the shasum of a buffer or object.
Description - Install - Usage - License: Apache-2.0
Description
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.
Install
npm install shasum-objectUsage
var fs = require('fs')
var shasum = require('shasum-object')
shasum('of a string')
shasum(fs.readFileSync('of-a-file.txt'))
shasum({
of: ['an', 'object']
})API
shasum(input, algorithm = 'sha1', encoding = 'hex')
Compute the hash for the given input.
input- a string, buffer or JSON object. objects are stringified usingfast-safe-stringify.algorithm- the hash algorithm to use. seecrypto.createHash.encoding- how to encode the hash result. seehash.digest.