SimpleCryptPassword
Implements \Joomla\CMS\Crypt\CryptPasswordJoomla Platform Password Crypter
since |
3.0.1 |
---|---|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Methods
create
Creates a password hash
create(string $password, string $type = null) : mixed
since |
3.0.1 |
---|---|
throws |
|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Arguments
- $password
string
The password to hash.- $type
string
The hash type.
Response
mixed
The hashed password or false if the password is too long.
getDefaultType
Gets the default type
getDefaultType() : string
since |
3.1.4 |
---|---|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Response
string
$type The default type
getSalt
Generates a salt of specified length. The salt consists of characters in the set [./0-9A-Za-z].
getSalt(integer $length) : string
since |
3.0.1 |
---|---|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Arguments
- $length
integer
The number of characters to return.
Response
string
The string of random characters.
setCost
Sets the cost parameter for the generated hash for algorithms that use a cost factor.
setCost(integer $cost) : void
since |
3.0.1 |
---|---|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Arguments
- $cost
integer
The new cost value.
setDefaultType
Sets a default type
setDefaultType(string $type) : void
since |
3.1.4 |
---|---|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Arguments
- $type
string
The value to set as default.
verify
Verifies a password hash
verify(string $password, string $hash) : boolean
since |
3.0.1 |
---|---|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Arguments
- $password
string
The password to verify.- $hash
string
The password hash to check.
Response
boolean
True if the password is valid, false otherwise.
Properties
cost
The cost parameter for hashing algorithms.
since |
3.0.1 |
---|---|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Type(s)
integer
defaultType
The default hash type
since |
3.1.4 |
---|---|
deprecated |
4.0 Use PHP 5.5's native password hashing API |
Type(s)
string