original_string: protected function truncate($hash)
  	{
  		$truncated_hash = 0;
  		$offset = ord(substr($hash, -1)) & 0xF;
  
  		// Truncate hash using supplied sha1 hash
  		for ($i = 0; $i < 4; ++$i)
  		{
  			$truncated_hash <<= 8;
  			$truncated_hash  |= ord($hash[$offset + $i]);
  		}
  
  		// Truncate to a smaller number of digits.
  		$truncated_hash &= 0x7FFFFFFF;
  		$truncated_hash %= self::VERIFICATION_CODE_MODULUS;
  
  		return $truncated_hash;
  	}
code: protected function truncate($hash)
  	{
  		$truncated_hash = 0;
  		$offset = ord(substr($hash, -1)) & 0xF;
  
  		// Truncate hash using supplied sha1 hash
  		for ($i = 0; $i < 4; ++$i)
  		{
  			$truncated_hash <<= 8;
  			$truncated_hash  |= ord($hash[$offset + $i]);
  		}
  
  		// Truncate to a smaller number of digits.
  		$truncated_hash &= 0x7FFFFFFF;
  		$truncated_hash %= self::VERIFICATION_CODE_MODULUS;
  
  		return $truncated_hash;
  	}
code_tokens: protected function truncate ( $ hash ) { $ truncated_hash = 0 ; $ offset = ord ( substr ( $ hash , - 1 ) ) & 0xF ; // Truncate hash using supplied sha1 hash for ( $ i = 0 ; $ i < 4 ; ++ $ i ) { $ truncated_hash <<= 8 ; $ truncated_hash |= ord ( $ hash [ $ offset + $ i ] ) ; } // Truncate to a smaller number of digits. $ truncated_hash &= 0x7FFFFFFF ; $ truncated_hash %= self :: VERIFICATION_CODE_MODULUS ; return $ truncated_hash ; }
docstring: Truncate HMAC hash to binary for generating a TOTP code
  
  @param string $hash HMAC hash
  
  @return int Truncated binary hash
docstring_tokens: Truncate HMAC hash to binary for generating a TOTP code