Ejemplo n.º 1
0
exports.sha3 = function (a, bytes) {
  a = exports.toBuffer(a)
  if (!bytes) bytes = 256

  var h = new SHA3(bytes)
  if (a) {
    h.update(a)
  }
  return new Buffer(h.digest('hex'), 'hex')
}
Ejemplo n.º 2
0
function sha3(bytes, length){
  bytes = toBuffer(bytes)
  if (!length) length = 256

  var h = new SHA3(length)
  if (bytes) {
    h.update(bytes)
  }
  return new Buffer(h.digest('hex'), 'hex')
}