Commit d1934b73 authored by Taylor Otwell's avatar Taylor Otwell

Add ability to specify iteration count in Hash class.

parent f28a2c5a
...@@ -12,9 +12,9 @@ class Hash { ...@@ -12,9 +12,9 @@ class Hash {
* @param string $value * @param string $value
* @return string * @return string
*/ */
public static function make($value) public static function make($value, $rounds = 10)
{ {
return static::hasher()->HashPassword($value); return static::hasher($rounds)->HashPassword($value);
} }
/** /**
...@@ -32,13 +32,14 @@ class Hash { ...@@ -32,13 +32,14 @@ class Hash {
/** /**
* Create a new PHPass instance. * Create a new PHPass instance.
* *
* @param int $rounds
* @return PasswordHash * @return PasswordHash
*/ */
private static function hasher() private static function hasher($rounds = 10)
{ {
require_once SYS_PATH.'vendor/phpass'.EXT; require_once SYS_PATH.'vendor/phpass'.EXT;
return new \PasswordHash(10, false); return new \PasswordHash($rounds, false);
} }
} }
\ No newline at end of file \ No newline at end of file
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