Zend\Crypt\Password\Bcrypt
Bcrypt algorithm using crypt() function of PHP
Synopsis
class Bcrypt
implements
PasswordInterface
{
- // constants
- const MIN_SALT_SIZE = 16;
- // members
- protected string $cost;
- protected string $salt;
- protected bool $backwardCompatibility;
- // methods
- public void __construct()
- public string create()
- public bool verify()
- public Bcrypt setCost()
- public string getCost()
- public Bcrypt setSalt()
- public string getSalt()
- public Bcrypt setBackwardCompatibility()
- public bool getBackwardCompatibility()
Hierarchy
Implements
Constants
Name | Value |
---|---|
MIN_SALT_SIZE | 16 |
Members
protected
- $backwardCompatibility — Zend\Crypt\Password\bool
- $cost — string
- $salt — string
Methods
public
- __construct() — Constructor
- create() — Bcrypt
- getBackwardCompatibility() — Get the backward compatibility
- getCost() — Get the cost parameter
- getSalt() — Get the salt value
- setBackwardCompatibility() — Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+
- setCost() — Set the cost parameter
- setSalt() — Set the salt value
- verify() — Verify if a password is correct against a hash value