Sha256: ca97f0f060e8d35137674b1e391d2e1cf160379a187e050c1216ebf79a85dbd7
Contents?: true
Size: 397 Bytes
Versions: 7
Compression:
Stored size: 397 Bytes
Contents
var createHash = require('crypto').createHash var Buffer = require('buffer').Buffer var stringify = require('json-stable-stringify') module.exports = function hash (str, alg, format) { str = 'string' === typeof str ? str : Buffer.isBuffer(str) ? str : stringify(str) return createHash(alg || 'sha1') .update(str, Buffer.isBuffer(str) ? null : 'utf8').digest(format || 'hex') }
Version data entries
7 entries across 7 versions & 2 rubygems