gun/sea/sha1.js
2018-06-14 14:46:56 -07:00

8 lines
307 B
JavaScript

// This internal func returns SHA-1 hashed data for KeyID generation
const __shim = require('./shim')
const subtle = __shim.subtle
const ossl = __shim.ossl ? __shim.__ossl : subtle
const sha1hash = (b) => ossl.digest({name: 'SHA-1'}, new ArrayBuffer(b))
module.exports = sha1hash