Disclaimer: Auto generated file.
Please help us setting parameters to useful values and extending the examples.
/**
* iaPwd::__construct()
*
* @param int $algorithm php's algorithm constant
* @param integer $cost
* @param array $policy
*/
/*
$iaPwd = new iaPwd(int $algorithm php's $algorithm = '2y', integer $cost = 10, array $policy = []);
*/
$iaPwd = new iaPwd();
- $iaPwd->get_policy() : array
/**
* Policy for min/max characters, digits, lowercase, uppercase, symbols, sequences
*
* @return array
*/ - $iaPwd->get_policy();
->
Array
(
[pwd_min_chars] => 12
[pwd_max_chars] => 60
[pwd_min_digitos] => 1
[pwd_min_minusculas] => 1
[pwd_min_mayusculas] => 1
[pwd_min_simbolos] => 1
[pwd_max_sequenciales] => 4
)
- $iaPwd->set_policy(array $policy) :
/**
* Set policy for min/max characters, digits, lowercase, uppercase, symbols, sequences
*
* @param array \$policy one or more keys from
* 'pwd_min_chars','pwd_max_chars', 'pwd_min_digitos', 'pwd_min_minusculas','pwd_min_mayusculas', 'pwd_min_simbolos', 'pwd_max_sequenciales'
*
*/ - $iaPwd->set_policy(['a' => '1', 'b' => '2', 'c' => 3]);
->
- $iaPwd->set_irregularSequences( $irregularSequences) :
- $iaPwd->set_irregularSequences(null /* == */);
->
- $iaPwd->passwordPolicyCheck(string $pwd) : string
/**
* Check the passwords complies with character's policy
*
* @param string \$pwd
* @return string error message or empty
*/ - $iaPwd->passwordPolicyCheck('palabra'); -> al menos 12 y máximo 60 caracteres
- $iaPwd->passwordHash(string $password) : string
/**
* Hash the password
*
* @param string \$password
* @return string
*/ - $iaPwd->passwordHash('palabra'); -> $2y$10$C54IGDI.eyIsNUa/UxrYX.wGggGJXjlTYFDJjmBB4EPEkt0HxCPzK
- $iaPwd->passwordVerify(string $password, string $hash) : bool
/**
* Check password matches hash
*
* @param string \$password
* @param string \$hash
* @return bool
*/ - $iaPwd->passwordVerify('palabra', 'palabra'); -> false
- $iaPwd->passwordNeedsRehash(string $hash) : string
/**
* Rehash the pasword's hash, for example on cost, algorithm change
*
* @param string \$hash
* @return string
*/ - $iaPwd->passwordNeedsRehash('palabra'); -> 1
- $iaPwd->costRecomended(float $timeTarget = 0.1) : int
/**
* Recomend best cost for time target in seconds
*
* @param float \$timeTarget (seconds)
* @return int recomended password cost
*/ - $iaPwd->costRecomended(); -> 11
|