name : test.php
<?php

$options = [
    'cost' => 12,
];
echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."\n";

$hash = '$2y$12$QQjkPN0iDsl0g24blzLt..xdPGvJj.EixL/BhkKz0uBU1lUjrvrO.';
if (password_verify('rasmuslerdorf', $hash)) {
    echo 'Password is valid!';
} else {
    echo 'Invalid password.';
}

?>

© 2024 UnknownSec