Skip to content

Commit a879923

Browse files
authored
Merge pull request #916 from datamweb/update-hash-cost
refactor: update default value `$hashCost` to 12
2 parents 56ab89e + 05826bc commit a879923

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Config/Auth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,14 @@ class Auth extends BaseConfig
356356
* --------------------------------------------------------------------
357357
* The BCRYPT method of hashing allows you to define the "cost"
358358
* or number of iterations made, whenever a password hash is created.
359-
* This defaults to a value of 10 which is an acceptable number.
359+
* This defaults to a value of 12 which is an acceptable number.
360360
* However, depending on the security needs of your application
361361
* and the power of your hardware, you might want to increase the
362362
* cost. This makes the hashing process takes longer.
363363
*
364364
* Valid range is between 4 - 31.
365365
*/
366-
public int $hashCost = 10;
366+
public int $hashCost = 12;
367367

368368
/**
369369
* If you need to support passwords saved in versions prior to Shield v1.0.0-beta.4.

tests/Unit/PasswordsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testHash(): string
5252
public function testNeedsRehashTakesCareOptions(string $hashedPassword): void
5353
{
5454
$config = new AuthConfig();
55-
$config->hashCost = 12;
55+
$config->hashCost = 13;
5656
$passwords = new Passwords($config);
5757

5858
$result = $passwords->needsRehash($hashedPassword);

0 commit comments

Comments
 (0)