From d1934b731eafc688e00975734bba8c071e9a62bc Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 8 Aug 2011 09:01:53 -0500 Subject: [PATCH] Add ability to specify iteration count in Hash class. --- system/hash.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/system/hash.php b/system/hash.php index de53321f..11d6c006 100644 --- a/system/hash.php +++ b/system/hash.php @@ -12,9 +12,9 @@ class Hash { * @param string $value * @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 { /** * Create a new PHPass instance. * + * @param int $rounds * @return PasswordHash */ - private static function hasher() + private static function hasher($rounds = 10) { 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