1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 11:42:17 +02:00
Files
archived-php-src/ext/hash
Christoph M. Becker 35b19cd2d9 Make this test meaningful
We're not only checking that hash_update_file() succeeds, but rather
that it properly works.

Furthermore, we fix the SKIPIF section – we don't need mhash to run the
test, and we don't need to check for unsupported PHP versions.

We also shorten the test name to avoid cluttering the test reports with
unnecessary detail.
2016-10-18 14:57:41 +02:00
..
2016-10-18 14:57:41 +02:00
2015-10-15 20:36:49 -07:00
2016-06-22 00:40:50 +03:00
2013-08-06 22:49:56 +02:00

Generic hashing framework for PHP

Simplest usages:

$digest = hash($algoname, $message);
$digest = hash_file($algoname, $filename);

Examples:

$digest = hash('md5', 'The quick brown fox jumped over the lazy dog.');

Feeder usage:

$context = hash_init($algoname);
hash_update($context, $message);
$digest = hash_final($context);

hash(), hash_file(), and hash_final() each support an optional boolean parameter $raw_output which behaves in the same 
manner as sha1()'s optional parameter.