Commit 28d11f15 authored by Taylor Otwell's avatar Taylor Otwell

Refactoring Hash class.

parent 77c23c46
...@@ -25,15 +25,7 @@ class Hash { ...@@ -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);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment