Guest User

Untitled

a guest
Nov 17th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. class Password
  4. {
  5. public static function hash(string $password): string
  6. {
  7. return password_hash(base64_encode(hash('sha384', $password, true)), PASSWORD_BCRYPT);
  8. }
  9.  
  10. public static function verify(string $password, string $hash): bool
  11. {
  12. return password_verify(
  13. base64_encode(
  14. hash('sha384', $password, true)
  15. ),
  16. $hash
  17. );
  18. }
  19. }
Add Comment
Please, Sign In to add comment