dist/index.common.js
function hashDocument(document) {
  var words;

  if (Buffer.isBuffer(document)) {
    words = Base64.parse(document.toString('base64'));
  } else if (typeof document === 'string') {
    words = Base64.parse(document);
  } else {
    throw new TypeError('Expected document to be Buffer or String');
  }

  var hash = sha256(words);

  return hash.toString(Hex);
}
function hashDocument(document) {
  var words;

  if (Buffer.isBuffer(document)) {
    words = Base64.parse(document.toString('base64'));
  } else if (typeof document === 'string') {
    words = Base64.parse(document);
  } else {
    throw new TypeError('Expected document to be Buffer or String');
  }

  var hash = sha256(words);

  return hash.toString(Hex);
}
function hashDocument ( document ) { var words ; if ( Buffer . isBuffer ( document ) ) { words = Base64 . parse ( document . toString ( 'base64' ) ) ; } else if ( typeof document === 'string' ) { words = Base64 . parse ( document ) ; } else { throw new TypeError ( 'Expected document to be Buffer or String' ) ; } var hash = sha256 ( words ) ; return hash . toString ( Hex ) ; }
Generate hash of a document
@param {string|buffer} document - The document as a string or buffer
@return {string} Hex string representing hash
Generate hash of a document