Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Dec 5, 2020
Embed
What would you like to do?
<?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