summaryrefslogtreecommitdiff
path: root/ext/hash/hash.stub.php
blob: 5f28ad9799ff4bc33dd03b409c88389b579e96cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php

/** @return string|false */
function hash(string $algo, string $data, bool $raw_output = false) {}

/** @return string|false */
function hash_file(string $algo, string $filename, bool $raw_output = false) {}

/** @return string|false */
function hash_hmac(string $algo, string $data, string $key, bool $raw_output = false) {}

/** @return string|false */
function hash_hmac_file(string $algo, string $data, string $key, bool $raw_output = false) {}

function hash_init(string $algo, int $options = 0, string $key = UNKNOWN): HashContext {}

/** @return true */
function hash_update(HashContext $context, string $data): bool {}

/** @param resource $handle */
function hash_update_stream(HashContext $context, $handle, int $length = -1): int {}

/** @param resource $stream_context */
function hash_update_file(HashContext $context, string $filename, $stream_context = UNKNOWN): bool {}

function hash_final(HashContext $context, bool $raw_output = false): string {}

function hash_copy(HashContext $context): HashContext {}

function hash_algos(): array {}

function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $raw_output = false): string {}

/**
 * @param $known_string no type juggling is performed
 * @param $user_string no type juggling is performed
 */
function hash_equals(string $known_string, string $user_string) : bool {}

function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string {}

#ifdef PHP_MHASH_BC
/** @return int|false */
function mhash_get_block_size(int $hash) {}

/** @return string|false */
function mhash_get_hash_name(int $hash) {}

/** @return string|false */
function mhash_keygen_s2k(int $hash, string $input_password, string $salt, int $bytes) {}

function mhash_count(): int {}

/** @return string|false */
function mhash(int $hash, string $data, string $key = UNKNOWN) {}
#endif

class HashContext {
    private function __construct() {}
}