You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
5 years ago | |
---|---|---|
.. | ||
test | 5 years ago | |
.travis.yml | 5 years ago | |
CHANGELOG.md | 5 years ago | |
CODE_OF_CONDUCT.md | 5 years ago | |
LICENSE.md | 5 years ago | |
README.md | 5 years ago | |
bin.js | 5 years ago | |
index.js | 5 years ago |
README.md
shasum-object
get the shasum of a buffer or object
Install - Usage - License: Apache-2.0
Install
npm install shasum-object
Usage
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
.