Verify current header

@param {string} currentHash
@param {BitcoinHeader} currentHeader
@param {string} hashPrevBlock
@param {BitcoinHeader} prevHeader
@param {{bits: number, target: string}} target
@param {Boolean} isTestnet
@throws {VerifyHeaderError}
559028
function verifyHeader (currentHash, currentHeader, hashPrevBlock, prevHeader, target, isTestnet) {
  try {
    // check hashPrevBlock
    assert.equal(hashPrevBlock, currentHeader.hashPrevBlock)

    try {
      // check difficulty
      assert.equal(currentHeader.bits, target.bits)
      // check hash and target
      assert.equal(isGoodHash(currentHash, target.target), true)

    } catch (err) {
      // special case for testnet:
      // If no block has been found in 20 minutes, the difficulty automatically
      //  resets back to the minimum for a single block, after which it returns
      //  to its previous value.
      if (!(err instanceof assert.AssertionError &&
            isTestnet &&
            currentHeader.time - prevHeader.time > 1200)) {
        throw err
      }

      assert.equal(currentHeader.bits, MAX_BITS)
      assert.equal(isGoodHash(currentHash, MAX_TARGET), true)
    }
  } catch (err) {
    if (err instanceof assert.AssertionError) {
      throw new errors.Blockchain.VerifyHeaderError(currentHash, 'verification failed')
    }

    throw err
  }
}
821222
function _jws_getHashAlgFromParsedHead(head) {
	var sigAlg = head["alg"];
	var hashAlg = "";

	if (sigAlg != "RS256" && sigAlg != "RS512" &&
	    sigAlg != "PS256" && sigAlg != "PS512")
	    throw "JWS signature algorithm not supported: " + sigAlg;
	if (sigAlg.substr(2) == "256") hashAlg = "sha256";
	if (sigAlg.substr(2) == "512") hashAlg = "sha512";
	return hashAlg;
    }
1322768
function checkVhash(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  // Skip `#`.
  if (tokens[i].type === TokenType.NumberSign) i++;
  else return 0;

  if (l = checkNmName2(i)) i += l;
  else return 0;

  return i - start;
}
789544
function _checkNewHash(filename, data) {
    var shasum = crypto.createHash('sha1');
    shasum.update(data);
    var hash = shasum.digest('hex');
    if (hash === hashes[filename]) {
      return null;
    }
    return hash;
  }
1169913
def hash_block
      hash_string = [index,timestamp,data,prev_hash].join
      sha = Digest::SHA256.new
      sha.update(hash_string)
      sha.hexdigest
    end
882193
function useHash(hashString) {
    window.location.hash = hashString;
    readHash();
    setSliders();
    updateDisplay();
    distorter.run();
  }
110265
function processFileBySha1Hash(stream, firstPass, basePath, file, cache) {
  // null cannot be hashed
  if (file.contents === null) {
    // if element is really a file, something weird happened, but it's safer
    // to assume it was changed (because we cannot said that it wasn't)
    // if it's not a file, we don't care, do we? does anybody transform directories?
    if (file.stat.isFile()) {
      stream.push(file);
    }
  } else {
    var newHash = crypto.createHash('sha1').update(file.contents).digest('hex');
    var filePath = basePath ? path.relative(basePath, file.path) : file.path;
    var currentHash = cache[filePath];

    cache[filePath] = newHash;

    if ((!currentHash && firstPass) || (currentHash && currentHash !== newHash)) {
      stream.push(file);
    }
  }
}
92343
function(){
					if(_isActive) return;

					_hash = _getWindowHash();

					//thought about branching/overloading hasher.init() to avoid checking multiple times but
					//don't think worth doing it since it probably won't be called multiple times.
					if(_isHashChangeSupported){
						_addListener(window, 'hashchange', _checkHistory);
					}else {
						if(_isLegacyIE){
							if(! _frame){
								_createFrame();
							}
							_updateFrame();
						}
						_checkInterval = setInterval(_checkHistory, POOL_INTERVAL);
					}

					_isActive = true;
					hasher.initialized.dispatch(_trimHash(_hash));
				}
507582
function (target) {
        var element = this.hashForMethods[target.id]
        if (element) {
            element.paused = true
        }

        var elementUpdate = this.hashForUpdates[target.id]
        if (elementUpdate) {
            elementUpdate.paused = true
        }
    }
265962
function HashThrough (createHash) {
  const hashThrough = new Transform()

  const hash = createHash()

  hashThrough._transform = function (chunk, encoding, cb) {
    setImmediate(_ => {
      try {
        hash.update(chunk)
        cb(null, chunk)
      } catch (err) {
        cb(err)
      }
    })
  }

  // bind the digest function to hash object
  hashThrough.digest = format => hash.digest(format)

  return hashThrough
}
1321347
public function isValidResponse($username, $hash, $challenge)
	{
		if(self::NTLM_BLOB_HEADER != substr($this->clientBlob, 0, 8))
		{
			return false;
		}
	
		// Timstamp, seconds since january 1, 1601, used in replay-attack prevention.
		// 	$str = (float)vsprintf('%u%04u%04u%04u', array_reverse(unpack('vt1/vt2/vt3/vt4', substr($this->clientBlob, 8, 8))));
		// 	$seconds = floor($str / 1000000);
	
		// Client nonce, useful in replay-attack prevention.
		// 	$cnonce = substr($this->clientBlob, 16, 8);
	
		if(!SecurityUtil::timingSafeEquals($username, $this->username))
		{
			return false;
		}
		
		if(!SecurityUtil::timingSafeEquals($this->provider->getDomain(), $this->domain))
		{
			return false;
		}
		
		$ntlmhash = $this->computeHmacMd5($hash, $this->encodeUtf16(strtoupper($this->username) . $this->domain));
		$hash = (string)$this->computeHmacMd5($ntlmhash, $challenge . $this->clientBlob);
		
		if(!SecurityUtil::timingSafeEquals($hash, $this->clientHash))
		{
			return false;
		}
		
		return true;
	}
931419
def previous_hashes(self) -> Optional[Iterable[Hash32]]:
        
        return self.get_prev_hashes(self.header.parent_hash, self.chaindb)
61826
private byte[] generateUserSpecifiedHash(StreamNode node, Hasher hasher) {
		hasher.putString(node.getTransformationUID(), Charset.forName("UTF-8"));

		return hasher.hash().asBytes();
	}
596680
function handleHashChange() {
  var prefix = '#pipeline-';
  var hash = location.hash;
  var pieces = hash.split(';', 2);
  var pipelineId = null;

  if (pieces[0].indexOf(prefix) == 0) {
    pipelineId = pieces[0].substr(prefix.length);
  } else {
    // Bad hash, just show the root pipeline.
    location.hash = '';
    return;
  }

  if (!pipelineId) {
    // No hash means show the root pipeline.
    pipelineId = STATUS_MAP.rootPipelineId;
  }
  var rootMap = STATUS_MAP.pipelines[STATUS_MAP.rootPipelineId];
  var infoMap = STATUS_MAP.pipelines[pipelineId];
  if (!rootMap || !infoMap) {
    // Hash not found.
    return;
  }

  // Clear any selection styling.
  $('.selected-link').removeClass('selected-link');

  if (pieces[1]) {
    // Show a specific status link.
    var statusLink = $(getTreePipelineElementId(pipelineId))
        .find('.status-links>a:contains("' + pieces[1] + '")');
    if (statusLink.size() > 0) {
      var selectedLink = $(statusLink[0]);
      selectedLink.addClass('selected-link');
      $('#status-console').attr('src', selectedLink.attr('href'));
      $('#status-console').show();
    } else {
      // No console link for this pipeline; ignore it.
      $('#status-console').hide();
    }
  } else {
    // Show the console link.
    var consoleLink = $(getTreePipelineElementId(pipelineId))
        .find('a.status-console');
    if (consoleLink.size() > 0) {
      var selectedLink = $(consoleLink[0]);
      selectedLink.addClass('selected-link');
      $('#status-console').attr('src', selectedLink.attr('href'));
      $('#status-console').show();
    } else {
      // No console link for this pipeline; ignore it.
      $('#status-console').hide();
    }
  }

  // Mark the pipeline as selected.
  var selected = $('#link-pipeline-' + pipelineId);
  selected.addClass('selected-link');
  selected.parents('.status-box').addClass('selected-link');

  // Title is always the info for the root pipeline, to make it easier to
  // track across multiple tabs.
  document.title = rootMap.classPath + ' - ID #' + STATUS_MAP.rootPipelineId;

  // Update the detail status frame.
  var stageNode = constructStageNode(pipelineId, infoMap, false);
  $('#overview').remove();
  stageNode.attr('id', 'overview');
  $('#detail').append(stageNode);

  // Make sure everything is the right size.
  adjustStatusConsole();
}
643990
function BlockProof(hash, root, nonce1, nonce2, time, nonce) {
  this.hash = hash;
  this.root = root;
  this.nonce1 = nonce1;
  this.nonce2 = nonce2;
  this.time = time;
  this.nonce = nonce;
}
845079
private boolean hasHashChanged(Set<RegData> regData) {
        for (RegData el : regData) {
            if (hasHashChanged(mHasher, el)) {
                Log.d("CHANGED", el.getURLExternalForm());
                return true;
            }
        }
        return false;
    }
833033
function AuthChallengePacket(hash) {
  if (!(this instanceof AuthChallengePacket))
    return new AuthChallengePacket(hash);

  Packet.call(this);

  this.hash = hash || encoding.ZERO_HASH;
}