xref: /PHP-8.0/ext/hash/hash.stub.php (revision fd3fc5c1)
1<?php
2
3/** @generate-function-entries */
4
5function hash(string $algo, string $data, bool $binary = false): string {}
6
7function hash_file(string $algo, string $filename, bool $binary = false): string|false {}
8
9function hash_hmac(string $algo, string $data, string $key, bool $binary = false): string {}
10
11function hash_hmac_file(string $algo, string $filename, string $key, bool $binary = false): string|false {}
12
13function hash_init(string $algo, int $flags = 0, string $key = ""): HashContext {}
14
15function hash_update(HashContext $context, string $data): bool {}
16
17/** @param resource $stream */
18function hash_update_stream(HashContext $context, $stream, int $length = -1): int {}
19
20/** @param resource|null $stream_context */
21function hash_update_file(HashContext $context, string $filename, $stream_context = null): bool {}
22
23function hash_final(HashContext $context, bool $binary = false): string {}
24
25function hash_copy(HashContext $context): HashContext {}
26
27function hash_algos(): array {}
28
29function hash_hmac_algos(): array {}
30
31function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $binary = false): string {}
32
33function hash_equals(string $known_string, string $user_string): bool {}
34
35function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = ""): string {}
36
37#ifdef PHP_MHASH_BC
38function mhash_get_block_size(int $algo): int|false {}
39
40function mhash_get_hash_name(int $algo): string|false {}
41
42function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length): string|false {}
43
44function mhash_count(): int {}
45
46function mhash(int $algo, string $data, ?string $key = null): string|false {}
47#endif
48
49final class HashContext
50{
51    private function __construct() {}
52
53    public function __serialize(): array {}
54
55    public function __unserialize(array $data): void {}
56}
57