Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Password
- {
- public static function hash(string $password): string
- {
- return password_hash(base64_encode(hash('sha384', $password, true)), PASSWORD_BCRYPT);
- }
- public static function verify(string $password, string $hash): bool
- {
- return password_verify(
- base64_encode(
- hash('sha384', $password, true)
- ),
- $hash
- );
- }
- }
Add Comment
Please, Sign In to add comment