blob: 2571b02e9ab77e60fb211a789077fe37c0240356 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
--TEST--
Test crypt compatibility with password_hash
--FILE--
<?php
$secret = 'mysecret';
/* generate with password_hash, check with both */
$h = password_hash($secret, PASSWORD_BCRYPT);
var_dump($h, password_verify($secret, $h), $h===crypt($secret, $h));
/* generate with crypt, check with both */
$h = crypt($secret, crypt_gensalt(CRYPT_PREFIX_BLOWFISH));
var_dump($h, password_verify($secret, $h), $h===crypt($secret, $h));
?>
--EXPECTF--
string(60) "$2y$%s$%s"
bool(true)
bool(true)
string(60) "$2y$%s$%s"
bool(true)
bool(true)
|