25 lines
414 B
PHP
25 lines
414 B
PHP
<?php
|
|
|
|
/**
|
|
* Auth Class
|
|
* TODO move all auth related topics here
|
|
* @author lutranf
|
|
*
|
|
*/
|
|
class Auth
|
|
{
|
|
const ALGO = PASSWORD_DEFAULT;
|
|
const COST = 12;
|
|
|
|
public static function HashPassword($sPass)
|
|
{
|
|
return password_hash($sPass, self::ALGO, array('cost'=>self::COST));
|
|
}
|
|
|
|
public static function CheckPassword($sPass, $sHash)
|
|
{
|
|
return password_verify($sPass, $sHash);
|
|
}
|
|
}
|
|
|
|
?>
|