com php-src: UPGRADING: Document algorithm specific hash options [ci skip]: UPGRADING

From: Date: Sun, 13 Dec 2020 15:46:32 +0000
Subject: com php-src: UPGRADING: Document algorithm specific hash options [ci skip]: UPGRADING
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-114422@lists.php.net to get a copy of this message
Commit: c6d3c68fb4d35f85fe45481e5f7d63a9ec68bb6d Author: Anatol Belski <ab@php.net> Sun, 13 Dec 2020 16:36:57 +0100 Parents: 110b4e90946b6d46864c54c0e15b7a0deb6ad4b3 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c6d3c68fb4d35f85fe45481e5f7d63a9ec68bb6d Log: UPGRADING: Document algorithm specific hash options [ci skip] Signed-off-by: Anatol Belski <ab@php.net> Changed paths: M UPGRADING Diff: diff --git a/UPGRADING b/UPGRADING index dcc8641f2d5..c1d4e564c4d 100644 --- a/UPGRADING +++ b/UPGRADING @@ -24,12 +24,29 @@ PHP 8.1 UPGRADE NOTES ======================================== - hash: - . Added MurmurHash3 with streaming support. The following variants are implemented + . The following functions have changed signatures: + + - function hash(string $algo, string $data, bool $binary = false, array $options = []): string|false {} + - function hash_file(string $algo, string $filename, bool $binary = false, array $options = []): string|false {} + - function hash_init(string $algo, int $flags = 0, string $key = "", array $options = []): HashContext {} + + The additional $options argument can be used to pass algorithm specific data. + + . Added MurmurHash3 with streaming support. The following variants are implemented: - murmur3a, 32-bit hash - murmur3c, 128-bit hash for x86 - murmur3f, 128-bit hash for x64 + The initial hash state can be passed through the seed key in the $options array, for example: + + ```php + $h = hash("murmur3f", $data, options: ["seed" => 42]); + echo $h, "\n"; + ``` + + A valid seed value is within the range from 0 to the plaform defined UINT_MAX, usually 4294967295. + ======================================== 3. Changes in SAPI modules ========================================

« previous php.cvs (#114422) next »