diff --git a/src/Illuminate/Hashing/ArgonHasher.php b/src/Illuminate/Hashing/ArgonHasher.php index ce89abd4c549..013249ab1f04 100644 --- a/src/Illuminate/Hashing/ArgonHasher.php +++ b/src/Illuminate/Hashing/ArgonHasher.php @@ -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. * diff --git a/src/Illuminate/Hashing/BcryptHasher.php b/src/Illuminate/Hashing/BcryptHasher.php index d81d5dd042a4..7209b92d9cec 100755 --- a/src/Illuminate/Hashing/BcryptHasher.php +++ b/src/Illuminate/Hashing/BcryptHasher.php @@ -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. * diff --git a/src/Illuminate/Hashing/HashManager.php b/src/Illuminate/Hashing/HashManager.php index 4cd630cc9d68..0d9ca759280a 100644 --- a/src/Illuminate/Hashing/HashManager.php +++ b/src/Illuminate/Hashing/HashManager.php @@ -14,7 +14,7 @@ class HashManager extends Manager implements Hasher */ public function createBcryptDriver() { - return new BcryptHasher; + return new BcryptHasher($this->app['config']['hashing.bcrypt'] ?? []); } /** @@ -24,7 +24,7 @@ public function createBcryptDriver() */ public function createArgonDriver() { - return new ArgonHasher; + return new ArgonHasher($this->app['config']['hashing.argon'] ?? []); } /**