1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 09:33:06 +02:00
Files
archived-php-src/ext/hash
=?UTF-8?q?Rouven=20We=C3=9Fling?= b7f59be9f4 Refactor HashContext into an object.
This allows better type hinting as well as potentially adding
methods in a followup diff.

Original patch by Rouven Weßling (github.com/realityking)
Heavily modified by Sara Golemon (github.com/sgolemon)
2017-01-31 19:28:35 -08:00
..
2015-10-15 20:36:49 -07:00
2017-01-21 07:46:52 +00:00
2017-01-31 19:28:35 -08:00
2013-08-06 22:49:56 +02:00
2017-01-04 11:23:42 -06: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.