Skip to content

Commit

Permalink
Passwords: BCRYPT changed to default algorithm
Browse files Browse the repository at this point in the history
Warning: the result in a database column can expand beyond 60 characters!
  • Loading branch information
dg committed Sep 4, 2018
1 parent ea89701 commit 200b5b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Security/Passwords.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Passwords
/**
* See http://php.net/manual/en/password.constants.php
*/
public function __construct(int $algo = PASSWORD_BCRYPT, array $options = [])
public function __construct(int $algo = PASSWORD_DEFAULT, array $options = [])
{
$this->algo = $algo;
$this->options = $options;
Expand Down
2 changes: 1 addition & 1 deletion tests/Security/Passwords.hash().phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require __DIR__ . '/../bootstrap.php';


Assert::truthy(
preg_match('#^\$2.\$\d\d\$.{53}\z#', (new Passwords)->hash(''))
preg_match('#^\$.{50,}\z#', (new Passwords)->hash(''))
);

Assert::truthy(
Expand Down

0 comments on commit 200b5b0

Please sign in to comment.