xref: /php-src/ext/hash/hash.stub.php (revision 29f98e74)
1<?php
2
3/** @generate-class-entries */
4
5/**
6 * @var int
7 * @cvalue PHP_HASH_HMAC
8 */
9const HASH_HMAC = UNKNOWN;
10
11/** @refcount 1 */
12function hash(string $algo, string $data, bool $binary = false, array $options = []): string {}
13
14/** @refcount 1 */
15function hash_file(string $algo, string $filename, bool $binary = false, array $options = []): string|false {}
16
17/**
18 * @refcount 1
19 */
20function hash_hmac(string $algo, string $data, #[\SensitiveParameter] string $key, bool $binary = false): string {}
21
22/**
23 * @refcount 1
24 */
25function hash_hmac_file(string $algo, string $filename, #[\SensitiveParameter] string $key, bool $binary = false): string|false {}
26
27/**
28 * @refcount 1
29 */
30function hash_init(string $algo, int $flags = 0, #[\SensitiveParameter] string $key = "", array $options = []): HashContext {}
31
32function hash_update(HashContext $context, string $data): true {}
33
34/** @param resource $stream */
35function hash_update_stream(HashContext $context, $stream, int $length = -1): int {}
36
37/** @param resource|null $stream_context */
38function hash_update_file(HashContext $context, string $filename, $stream_context = null): bool {}
39
40/** @refcount 1 */
41function hash_final(HashContext $context, bool $binary = false): string {}
42
43/** @refcount 1 */
44function hash_copy(HashContext $context): HashContext {}
45
46/**
47 * @return array<int, string>
48 * @compile-time-eval
49 * @refcount 1
50 */
51function hash_algos(): array {}
52
53/**
54 * @return array<int, string>
55 * @compile-time-eval
56 * @refcount 1
57 */
58function hash_hmac_algos(): array {}
59
60/**
61 * @refcount 1
62 */
63function hash_pbkdf2(string $algo, #[\SensitiveParameter] string $password, string $salt, int $iterations, int $length = 0, bool $binary = false, array $options = []): string {}
64
65function hash_equals(#[\SensitiveParameter] string $known_string, #[\SensitiveParameter] string $user_string): bool {}
66
67/**
68 * @refcount 1
69 */
70function hash_hkdf(string $algo, #[\SensitiveParameter] string $key, int $length = 0, string $info = "", string $salt = ""): string {}
71
72#ifdef PHP_MHASH_BC
73#[\Deprecated(since: '8.1')]
74function mhash_get_block_size(int $algo): int|false {}
75
76/**
77 * @refcount 1
78 */
79#[\Deprecated(since: '8.1')]
80function mhash_get_hash_name(int $algo): string|false {}
81
82/**
83 * @refcount 1
84 */
85#[\Deprecated(since: '8.1')]
86function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length): string|false {}
87
88#[\Deprecated(since: '8.1')]
89function mhash_count(): int {}
90
91/**
92 * @refcount 1
93 */
94#[\Deprecated(since: '8.1')]
95function mhash(int $algo, string $data, ?string $key = null): string|false {}
96#endif
97
98final class HashContext
99{
100    private function __construct() {}
101
102    public function __serialize(): array {}
103
104    public function __unserialize(array $data): void {}
105
106    public function __debugInfo(): array {}
107}
108