overall code refactoring.

This commit is contained in:
Taylor Otwell
2011-06-14 17:27:11 -05:00
parent af24e8db45
commit 30c83f265d
36 changed files with 720 additions and 559 deletions

View File

@@ -25,7 +25,14 @@ class Hash {
*/
public function __construct($value, $salt = null)
{
// -------------------------------------------------------
// 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);
}