Home
last modified time | relevance | path

Searched refs:hash (Results 1 – 25 of 164) sorted by relevance

1234567

/PHP-8.0/ext/hash/tests/
H A Dcrc32.phpt6 echo hash('crc32', ''), "\n";
7 echo hash('crc32', 'a'), "\n";
8 echo hash('crc32', 'abc'), "\n";
29 echo hash('crc32b', ''), "\n";
30 echo hash('crc32b', 'a'), "\n";
31 echo hash('crc32b', 'abc'), "\n";
52 echo hash('crc32c', ''), "\n";
53 echo hash('crc32c', 'a'), "\n";
54 echo hash('crc32c', 'ab'), "\n";
55 echo hash('crc32c', 'abc'), "\n";
[all …]
H A Dhash_error.phpt2 Hash: hash() function : error conditions
6 echo "*** Testing hash() : error conditions ***\n";
8 echo "\n-- Testing hash() function with invalid hash algorithm --\n";
10 hash('foo', '');
17 *** Testing hash() : error conditions ***
19 -- Testing hash() function with invalid hash algorithm --
20 hash(): Argument #1 ($algo) must be a valid hashing algorithm
H A Dripemd128.phpt5 echo hash('ripemd128', '') . "\n";
6 echo hash('ripemd128', 'a') . "\n";
7 echo hash('ripemd128', 'abc') . "\n";
8 echo hash('ripemd128', 'message digest') . "\n";
9 echo hash('ripemd128', 'abcdefghijklmnopqrstuvwxyz') . "\n";
10 echo hash('ripemd128', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
11 echo hash('ripemd128', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
12 echo hash('ripemd128', '123456789012345678901234567890123456789012345678901234567890123456789012345…
13 echo hash('ripemd128', str_repeat('a', 1000000)) . "\n";
H A Dripemd160.phpt5 echo hash('ripemd160', '') . "\n";
6 echo hash('ripemd160', 'a') . "\n";
7 echo hash('ripemd160', 'abc') . "\n";
8 echo hash('ripemd160', 'message digest') . "\n";
9 echo hash('ripemd160', 'abcdefghijklmnopqrstuvwxyz') . "\n";
10 echo hash('ripemd160', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
11 echo hash('ripemd160', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
12 echo hash('ripemd160', '123456789012345678901234567890123456789012345678901234567890123456789012345…
13 echo hash('ripemd160', str_repeat('a', 1000000)) . "\n";
H A Dripemd256.phpt5 echo hash('ripemd256', '') . "\n";
6 echo hash('ripemd256', 'a') . "\n";
7 echo hash('ripemd256', 'abc') . "\n";
8 echo hash('ripemd256', 'message digest') . "\n";
9 echo hash('ripemd256', 'abcdefghijklmnopqrstuvwxyz') . "\n";
10 echo hash('ripemd256', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
11 echo hash('ripemd256', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
12 echo hash('ripemd256', '123456789012345678901234567890123456789012345678901234567890123456789012345…
13 echo hash('ripemd256', str_repeat('a', 1000000)) . "\n";
H A Dripemd320.phpt5 echo hash('ripemd320', '') . "\n";
6 echo hash('ripemd320', 'a') . "\n";
7 echo hash('ripemd320', 'abc') . "\n";
8 echo hash('ripemd320', 'message digest') . "\n";
9 echo hash('ripemd320', 'abcdefghijklmnopqrstuvwxyz') . "\n";
10 echo hash('ripemd320', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
11 echo hash('ripemd320', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
12 echo hash('ripemd320', '123456789012345678901234567890123456789012345678901234567890123456789012345…
13 echo hash('ripemd320', str_repeat('a', 1000000)) . "\n";
H A Dgost.phpt5 echo hash('gost', ''), "\n";
6 echo hash('gost', 'The quick brown fox jumps over the lazy dog'), "\n";
7 echo hash('gost', 'The quick brown fox jumps over the lazy cog'), "\n";
8 echo hash('gost', str_repeat('a', 31)), "\n";
9 echo hash('gost', str_repeat('a', 32)), "\n";
10 echo hash('gost', str_repeat('a', 33)), "\n";
12 echo hash('gost-crypto', ''), "\n";
13 echo hash('gost-crypto', 'The quick brown fox jumps over the lazy dog'), "\n";
15 echo hash('gost-crypto', str_repeat('a', 31)), "\n";
16 echo hash('gost-crypto', str_repeat('a', 32)), "\n";
[all …]
H A Dadler32.phpt5 echo hash('adler32', ''), "\n";
6 echo hash('adler32', 'a'), "\n";
7 echo hash('adler32', 'abc'), "\n";
8 echo hash('adler32', 'message digest'), "\n";
9 echo hash('adler32', 'abcdefghijklmnopqrstuvwxyz'), "\n";
10 echo hash('adler32', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'), "\n";
11 echo hash('adler32', '12345678901234567890123456789012345678901234567890123456789012345678901234567…
H A Dmd2.phpt5 echo hash('md2', '') . "\n";
6 echo hash('md2', 'a') . "\n";
7 echo hash('md2', 'abc') . "\n";
8 echo hash('md2', 'message digest') . "\n";
9 echo hash('md2', 'abcdefghijklmnopqrstuvwxyz') . "\n";
10 echo hash('md2', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
11 echo hash('md2', '12345678901234567890123456789012345678901234567890123456789012345678901234567890'…
H A Dmd4.phpt6 echo hash('md4', '') . "\n";
7 echo hash('md4', 'a') . "\n";
8 echo hash('md4', 'abc') . "\n";
9 echo hash('md4', 'message digest') . "\n";
10 echo hash('md4', 'abcdefghijklmnopqrstuvwxyz') . "\n";
11 echo hash('md4', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
12 echo hash('md4', '12345678901234567890123456789012345678901234567890123456789012345678901234567890'…
H A Dbug73127.phpt2 Bug #73127 (gost-crypto hash incorrect if input data contains long 0xFF sequence)
8 echo hash('gost-crypto', $test1),
10 hash('gost', $test1),
12 hash('gost-crypto', $test2),
14 hash('gost', $test2),
16 hash('gost-crypto', ''),
18 hash('gost', '')
H A Dsha1.phpt5 echo hash('sha1', '') . "\n";
6 echo hash('sha1', 'a') . "\n";
7 echo hash('sha1', '012345678901234567890123456789012345678901234567890123456789') . "\n";
10 echo hash('sha1', 'abc') . "\n";
11 echo hash('sha1', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
12 echo hash('sha1', str_repeat('a', 1000000)) . "\n";
H A Dsha224.phpt5 echo hash('sha224', '') . "\n";
6 echo hash('sha224', 'a') . "\n";
7 echo hash('sha224', '012345678901234567890123456789012345678901234567890123456789') . "\n";
10 echo hash('sha224', 'abc') . "\n";
11 echo hash('sha224', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
12 echo hash('sha224', str_repeat('a', 1000000)) . "\n";
H A Dsha256.phpt5 echo hash('sha256', '') . "\n";
6 echo hash('sha256', 'a') . "\n";
7 echo hash('sha256', '012345678901234567890123456789012345678901234567890123456789') . "\n";
10 echo hash('sha256', 'abc') . "\n";
11 echo hash('sha256', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
12 echo hash('sha256', str_repeat('a', 1000000)) . "\n";
H A Dsha384.phpt5 echo hash('sha384', '') . "\n";
6 echo hash('sha384', 'a') . "\n";
7 echo hash('sha384', '012345678901234567890123456789012345678901234567890123456789') . "\n";
10 echo hash('sha384', 'abc') . "\n";
11 echo hash('sha384', 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmno…
12 echo hash('sha384', str_repeat('a', 1000000)) . "\n";
H A Dsha512.phpt5 echo hash('sha512', '') . "\n";
6 echo hash('sha512', 'a') . "\n";
7 echo hash('sha512', '012345678901234567890123456789012345678901234567890123456789') . "\n";
10 echo hash('sha512', 'abc') . "\n";
11 echo hash('sha512', 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmno…
12 echo hash('sha512', str_repeat('a', 1000000)) . "\n";
H A Dbug70312.phpt5 var_dump(hash('haval128,5', '1234567890123456789012345678901234567890123456789012345678901234'));
6 var_dump(hash('haval160,5', '1234567890123456789012345678901234567890123456789012345678901234'));
7 var_dump(hash('haval192,5', '1234567890123456789012345678901234567890123456789012345678901234'));
8 var_dump(hash('haval224,5', '1234567890123456789012345678901234567890123456789012345678901234'));
9 var_dump(hash('haval256,5', '1234567890123456789012345678901234567890123456789012345678901234'));
H A Dtiger.phpt5 echo hash('tiger192,3', ''),"\n";
6 echo hash('tiger192,3', 'abc'),"\n";
7 echo hash('tiger192,3', str_repeat('a', 63)),"\n";
8 echo hash('tiger192,3', str_repeat('abc', 61)),"\n";
9 echo hash('tiger192,3', str_repeat('abc', 64)),"\n";
H A Dsnefru.phpt5 echo hash('snefru', ''), "\n";
6 echo hash('snefru', 'The quick brown fox jumps over the lazy dog'), "\n";
7 echo hash('snefru', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), "\n";
8 echo hash('snefru', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), "\n";
9 echo hash('snefru', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), "\n";
H A Dmhash_003.phpt22 foreach ($supported_hash_al as $hash=>$wanted) {
23 $passwd = str_repeat($hash, 10);
24 $salt = str_repeat($hash, 2);
25 $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100);
27 echo "$hash\nok\n";
29 echo "$hash: ";
31 echo "$hash: ";
H A Dhash_update_stream_basic_001.phpt2 Ensure hash_update_stream() always returns the same hash when $length = 0
14 // Create pseudo-random hash
16 $hash = sha1(bin2hex($bytes));
18 // Create temp file with hash
20 fwrite($fp, $hash);
23 // Stream it with 0 length and output hash
/PHP-8.0/Zend/
H A Dzend_string.h463 hash = hash * 33 + *str; in zend_inline_hash_func()
468 hash = ((hash << 5) + hash) + *str++; in zend_inline_hash_func()
469 hash = ((hash << 5) + hash) + *str++; in zend_inline_hash_func()
470 hash = ((hash << 5) + hash) + *str++; in zend_inline_hash_func()
471 hash = ((hash << 5) + hash) + *str++; in zend_inline_hash_func()
472 hash = ((hash << 5) + hash) + *str++; in zend_inline_hash_func()
473 hash = ((hash << 5) + hash) + *str++; in zend_inline_hash_func()
474 hash = ((hash << 5) + hash) + *str++; in zend_inline_hash_func()
475 hash = ((hash << 5) + hash) + *str++; in zend_inline_hash_func()
478 case 7: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */ in zend_inline_hash_func()
[all …]
/PHP-8.0/ext/standard/
H A Dpassword.c117 const char *h = ZSTR_VAL(hash); in php_password_bcrypt_valid()
163 if (ZSTR_LEN(ret) != ZSTR_LEN(hash) || ZSTR_LEN(hash) < 13) { in php_password_bcrypt_verify()
242 if (!hash || (ZSTR_LEN(hash) < sizeof("$argon2id$"))) { in extract_argon2_parameters()
525 if (!hash || ZSTR_LEN(hash) < 3) { in php_password_algo_extract_ident()
530 ident = ZSTR_VAL(hash) + 1; in php_password_algo_extract_ident()
557 zend_string *hash, *ident; in PHP_FUNCTION() local
561 Z_PARAM_STR(hash) in PHP_FUNCTION()
594 zend_string *hash; in PHP_FUNCTION() local
601 Z_PARAM_STR(hash) in PHP_FUNCTION()
626 zend_string *password, *hash; in PHP_FUNCTION() local
[all …]
H A Dphp_password.h39 zend_string *(*hash)(const zend_string *password, zend_array *options); member
40 zend_bool (*verify)(const zend_string *password, const zend_string *hash);
42 int (*get_info)(zval *return_value, const zend_string *hash);
43 zend_bool (*valid)(const zend_string *hash);
59 static inline const php_password_algo* php_password_algo_identify(const zend_string *hash) { in php_password_algo_identify() argument
60 return php_password_algo_identify_ex(hash, php_password_algo_default()); in php_password_algo_identify()
/PHP-8.0/ext/standard/tests/password/
H A Dpassword_needs_rehash_argon2.phpt11 $hash = password_hash('test', PASSWORD_ARGON2I);
12 var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I));
13 var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['memory_cost' => PASSWORD_ARGON2_DEFAULT_M…
14 var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['time_cost' => PASSWORD_ARGON2_DEFAULT_TIM…
16 $hash = password_hash('test', PASSWORD_ARGON2ID);
17 var_dump(password_needs_rehash($hash, PASSWORD_ARGON2ID));
18 var_dump(password_needs_rehash($hash, PASSWORD_ARGON2ID, ['memory_cost' => PASSWORD_ARGON2_DEFAULT_…
19 var_dump(password_needs_rehash($hash, PASSWORD_ARGON2ID, ['time_cost' => PASSWORD_ARGON2_DEFAULT_TI…

Completed in 39 milliseconds

1234567