Refactoring Hash class.

This commit is contained in:
Taylor Otwell 2011-07-06 14:26:04 -07:00
parent 77c23c4665
commit 28d11f15bb
1 changed files with 1 additions and 9 deletions

View File

@ -25,15 +25,7 @@ class Hash {
*/ */
public function __construct($value, $salt = null) public function __construct($value, $salt = null)
{ {
// ------------------------------------------------------- $this->value = sha1($value.$this->salt = (is_null($salt)) ? Str::random(16) : $salt);
// If no salt is given, we'll create a random salt to
// use when hashing the password.
//
// Otherwise, we will use the given salt.
// -------------------------------------------------------
$this->salt = (is_null($salt)) ? Str::random(16) : $salt;
$this->value = sha1($value.$this->salt);
} }
/** /**