rearrange hash class.

This commit is contained in:
Taylor Otwell 2012-01-26 10:29:19 -06:00
parent 1da0f231e5
commit a36e2773e2
1 changed files with 12 additions and 12 deletions

View File

@ -2,6 +2,18 @@
class Hash { class Hash {
/**
* Determine if an unhashed value matches a given Bcrypt hash.
*
* @param string $value
* @param string $hash
* @return bool
*/
public static function check($value, $hash)
{
return crypt($value, $hash) === $hash;
}
/** /**
* Hash a password using the Bcrypt hashing scheme. * Hash a password using the Bcrypt hashing scheme.
* *
@ -39,16 +51,4 @@ public static function make($value, $rounds = 8)
return crypt($value, '$2a$'.$work.'$'.$salt); return crypt($value, '$2a$'.$work.'$'.$salt);
} }
/**
* Determine if an unhashed value matches a given Bcrypt hash.
*
* @param string $value
* @param string $hash
* @return bool
*/
public static function check($value, $hash)
{
return crypt($value, $hash) === $hash;
}
} }