Function __global->hash_file

Definitions

sources_custom/phpstub.php

  • Generate a hash value using the contents of a given file.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$algo string No No required parameter N/A N/A Name of algorithm to use
$filename string No No required parameter N/A N/A File or URL to hash
$binary boolean No No False N/A N/A Whether to output raw binary data (false: output lowercase hex)
$options array No No [] N/A N/A Array of options for the hashing algorithm chosen

Returns

  • The hash (false: error)
  • Type: ~string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Generate a hash value using the contents of a given file.
 *
 * @param  string $algo Name of algorithm to use
 * @param  string $filename File or URL to hash
 * @param  boolean $binary Whether to output raw binary data (false: output lowercase hex)
 * @param  array $options Array of options for the hashing algorithm chosen
 * @return ~string The hash (false: error)
 */

function hash_file(string $algo, string $filename, bool $binary = false, array $options = [])