-
-
Save parzibyte/6638b298c44c9da440a1eb774b070f0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Parzibyte; | |
class Security | |
{ | |
static function hashPassword($password) | |
{ | |
return password_hash(self::preparePlainPassword($password), PASSWORD_BCRYPT); | |
} | |
static function verifyPassword($password, $hash) | |
{ | |
return password_verify(self::preparePlainPassword($password), $hash); | |
} | |
static function preparePlainPassword($password) | |
{ | |
return hash("sha256", $password); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment