\Pop\CryptCrypt

Crypt class

Summary

Methods
Properties
Constants
setSalt()
getSalt()
generateRandomString()
__construct()
create()
verify()
No public properties found
No constants found
strlen()
verifyHash()
$salt
N/A
No private methods found
No private properties found
N/A

Properties

$salt

$salt : string

Salt

Type

string

Methods

setSalt()

setSalt(string  $salt = null) : self

Set the salt

Parameters

string $salt

Returns

self

getSalt()

getSalt() : string

Get the salt

Returns

string

generateRandomString()

generateRandomString(integer  $length) : string

Generate a random alphanumeric string of a predefined length.

Parameters

integer $length

Returns

string

__construct()

__construct(string  $salt = null) : self

Constructor

Instantiate the crypt object.

Parameters

string $salt

Returns

self

create()

create(string  $string) : string

Create the hashed value

Parameters

string $string

Returns

string

verify()

verify(string  $string, string  $hash) : boolean

Verify the hashed value

Parameters

string $string
string $hash

Returns

boolean

strlen()

strlen(string  $string) : integer

Get string length

Parameters

string $string

Returns

integer

verifyHash()

verifyHash(string  $string, string  $hash) : boolean

Verify hash, timing-safe.

Credit: Anthony Ferrara's (ircmaxell) password compat library: https://github.com/ircmaxell/password_compat

Parameters

string $string
string $hash

Returns

boolean