@@ -24,12 +24,29 @@ PHP 8.1 UPGRADE NOTES
24
24
========================================
25
25
26
26
- hash:
27
- . Added MurmurHash3 with streaming support. The following variants are implemented
27
+ . The following functions have changed signatures:
28
+
29
+ - function hash(string $algo, string $data, bool $binary = false, array $options = []): string|false {}
30
+ - function hash_file(string $algo, string $filename, bool $binary = false, array $options = []): string|false {}
31
+ - function hash_init(string $algo, int $flags = 0, string $key = "", array $options = []): HashContext {}
32
+
33
+ The additional `$options` argument can be used to pass algorithm specific data.
34
+
35
+ . Added MurmurHash3 with streaming support. The following variants are implemented:
28
36
29
37
- murmur3a, 32-bit hash
30
38
- murmur3c, 128-bit hash for x86
31
39
- murmur3f, 128-bit hash for x64
32
40
41
+ The initial hash state can be passed through the `seed` key in the `$options` array, for example:
42
+
43
+ ```php
44
+ $h = hash("murmur3f", $data, options: ["seed" => 42]);
45
+ echo $h, "\n";
46
+ ```
47
+
48
+ A valid seed value is within the range from 0 to the plaform defined UINT_MAX, usually 4294967295.
49
+
33
50
========================================
34
51
3. Changes in SAPI modules
35
52
========================================
0 commit comments