class SimpleCryptPassword implements CryptPassword

Joomla Platform Password Crypter

Methods

string
create( string $password, string $type = null)

Creates a password hash

void
setCost( integer $cost)

Sets the cost parameter for the generated hash for algorithms that use a cost factor.

boolean
verify( string $password, string $hash)

Verifies a password hash

void
setDefaultType( string $type)

Sets a default type

void
getDefaultType()

Gets the default type

Details

string create( string $password, string $type = null)

Creates a password hash

Parameters

string $password The password to hash.
string $type The type of hash. This determines the prefix of the hashing function.

Return Value

string The hashed password.

Exceptions

InvalidArgumentException

void setCost( integer $cost)

Sets the cost parameter for the generated hash for algorithms that use a cost factor.

Parameters

integer $cost The new cost value.

Return Value

void

boolean verify( string $password, string $hash)

Verifies a password hash

Parameters

string $password The password to verify.
string $hash The password hash to check.

Return Value

boolean True if the password is valid, false otherwise.

void setDefaultType( string $type)

Sets a default type

Parameters

string $type The prefix to set as default

Return Value

void

void getDefaultType()

Gets the default type

Return Value

void