Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into huguesjoyal-5.6
  • Loading branch information
taylorotwell committed Mar 17, 2018
2 parents 1f62d23 + 76bbf5e commit d0ee95d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/Illuminate/Hashing/ArgonHasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ class ArgonHasher implements HasherContract
*/
protected $threads = 2;

/**
* Constructor.
*
* @param array $options
*/
public function __construct($options = null)
{
$this->memory = $options['memory'] ?? $this->memory;
$this->time = $options['time'] ?? $this->time;
$this->threads = $options['threads'] ?? $this->threads;
}

/**
* Get information about the given hashed value.
*
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Hashing/BcryptHasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ class BcryptHasher implements HasherContract
*/
protected $rounds = 10;

/**
* Constructor.
*
* @param array $options
*/
public function __construct($options = null)
{
$this->rounds = $options['rounds'] ?? $this->rounds;
}

/**
* Get information about the given hashed value.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Hashing/HashManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class HashManager extends Manager implements Hasher
*/
public function createBcryptDriver()
{
return new BcryptHasher;
return new BcryptHasher($this->app['config']['hashing.bcrypt'] ?? []);
}

/**
Expand All @@ -24,7 +24,7 @@ public function createBcryptDriver()
*/
public function createArgonDriver()
{
return new ArgonHasher;
return new ArgonHasher($this->app['config']['hashing.argon'] ?? []);
}

/**
Expand Down

0 comments on commit d0ee95d

Please sign in to comment.