package
get the shasum of a buffer or object
npm install shasum-objectGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Get the shasum of a buffer or object.
Description - Install - Usage - License: Apache-2.0
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-objectvar fs = require('fs')
var shasum = require('shasum-object')
shasum('of a string')
shasum(fs.readFileSync('of-a-file.txt'))
shasum({
of: ['an', 'object']
})shasum(input, algorithm = 'sha1', encoding = 'hex')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.Estimated unpacked size across 2 packages.
49.2 kB
Includes dependencies.