From 32def5933721cf9443a4759a9ec2150aced255b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lecerf?= Date: Mon, 8 Dec 2014 23:44:07 +0100 Subject: [PATCH] Allow to set default crypt cost factor --- src/Illuminate/Hashing/BcryptHasher.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Illuminate/Hashing/BcryptHasher.php b/src/Illuminate/Hashing/BcryptHasher.php index c5db5f51fff0..935c5d536440 100755 --- a/src/Illuminate/Hashing/BcryptHasher.php +++ b/src/Illuminate/Hashing/BcryptHasher.php @@ -59,4 +59,15 @@ public function needsRehash($hashedValue, array $options = array()) return password_needs_rehash($hashedValue, PASSWORD_BCRYPT, array('cost' => $cost)); } + /** + * Set the default crypt cost factor. + * + * @param int $rounds + * @return void + */ + public function setRounds($rounds) + { + $this->rounds = (int) $rounds; + } + }