tasks/jsonld/js/jsonld.js
function _hashQuads(id, bnodes, namer) {
  // return cached hash
  if('hash' in bnodes[id]) {
    return bnodes[id].hash;
  }

  // serialize all of bnode's quads
  var quads = bnodes[id].quads;
  var nquads = [];
  for(var i = 0; i < quads.length; ++i) {
    nquads.push(_toNQuad(
      quads[i], quads[i].name ? quads[i].name.value : null, id));
  }
  // sort serialized quads
  nquads.sort();
  // return hashed quads
  var hash = bnodes[id].hash = sha1.hash(nquads);
  return hash;
}
function _hashQuads(id, bnodes, namer) {
  // return cached hash
  if('hash' in bnodes[id]) {
    return bnodes[id].hash;
  }

  // serialize all of bnode's quads
  var quads = bnodes[id].quads;
  var nquads = [];
  for(var i = 0; i < quads.length; ++i) {
    nquads.push(_toNQuad(
      quads[i], quads[i].name ? quads[i].name.value : null, id));
  }
  // sort serialized quads
  nquads.sort();
  // return hashed quads
  var hash = bnodes[id].hash = sha1.hash(nquads);
  return hash;
}
function _hashQuads ( id , bnodes , namer ) { // return cached hash if ( 'hash' in bnodes [ id ] ) { return bnodes [ id ] . hash ; } // serialize all of bnode's quads var quads = bnodes [ id ] . quads ; var nquads = [ ] ; for ( var i = 0 ; i < quads . length ; ++ i ) { nquads . push ( _toNQuad ( quads [ i ] , quads [ i ] . name ? quads [ i ] . name . value : null , id ) ) ; } // sort serialized quads nquads . sort ( ) ; // return hashed quads var hash = bnodes [ id ] . hash = sha1 . hash ( nquads ) ; return hash ; }
Hashes all of the quads about a blank node.

@param id the ID of the bnode to hash quads for.
@param bnodes the mapping of bnodes to quads.
@param namer the canonical bnode namer.

@return the new hash.
Hashes all of the quads about a blank node .