password class for knowledgeroot

author fhabermann
category Knowledgeroot
package Knowledgeroot_Version
copyright Copyright (c) 2012 Frank Habermann
license New BSD License

 Methods

construct object

__construct(string $password) 

Parameters

$password

string

optional password

generate hash value

generateHash(string $password, int $method, int $rotation, string $salt) : string
Static

Parameters

$password

string

$method

int

$rotation

int

$salt

string

Returns

string

get generated hash

getHash() : string

Returns

string

verify password with hash value

verify(\type $password, \type $hash) : bool
Static

Parameters

$password

\type

$hash

\type

Returns

bool

generate random key

generateRandomKey() : string

Returns

string

 Properties

 

$hash : string
 

$method : int
 

$rotation : integer
 

$salt : string

 Constants

 

available hash methods

HASH_MD5 
 

HASH_SHA1

HASH_SHA1 
 

HASH_SHA256

HASH_SHA256 
 

HASH_SHA384

HASH_SHA384 
 

HASH_SHA512

HASH_SHA512