PHP Class YiiPassword\Strategies\Bcrypt

Inheritance: extends YiiPassword\Strategy
Mostra file Open project: phpnode/yiipassword

Public Properties

Property Type Description
$workFactor integer The higher the work factor the more computationally expensive it is to encode and validate passwords. So it makes your passwords harder to crack, but it can also be a burden on your own server.

Public Methods

Method Description
encode ( string $password ) : string Encode a plain text password.

Protected Methods

Method Description
generateSalt ( ) : string Generates a random salt.
getRandomBytes ( integer $count = 16 ) : boolean | string Gets a number of random bytes

Method Details

encode() public method

Child classes should implement this method and do their encoding here
public encode ( string $password ) : string
$password string the plain text password to encode
return string the encoded password

generateSalt() protected method

Generates a random salt.
protected generateSalt ( ) : string
return string the generated salt

getRandomBytes() protected method

Gets a number of random bytes
protected getRandomBytes ( integer $count = 16 ) : boolean | string
$count integer the number of bytes to return
return boolean | string

Property Details

$workFactor public_oe property

The higher the work factor the more computationally expensive it is to encode and validate passwords. So it makes your passwords harder to crack, but it can also be a burden on your own server.
public int $workFactor
return integer