PHP Class Pop\Crypt\Sha

Author: Nick Sagona, III ([email protected])
Inheritance: implements Pop\Crypt\CryptInterface
Datei anzeigen Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$bits integer Bits
$rounds integer Rounds
$salt string Salt

Public Methods

Method Description
__construct ( integer $bits = 512, integer $rounds = 5000 ) : self Constructor
create ( string $string ) : string Method to create the hashed value
getBits ( ) : integer Method to get the bits
getRounds ( ) : integer Method to get the rounds
getSalt ( ) : string Method to get the salt
setBits ( integer $bits = 512 ) : self Method to set the cost
setRounds ( integer $rounds = 5000 ) : self Method to set the rounds
setSalt ( string $salt = null ) : self Method to set the salt
verify ( string $string, string $hash ) : boolean Method to verify the hashed value

Method Details

__construct() public method

Instantiate the sha object.
public __construct ( integer $bits = 512, integer $rounds = 5000 ) : self
$bits integer
$rounds integer
return self

create() public method

Method to create the hashed value
public create ( string $string ) : string
$string string
return string

getBits() public method

Method to get the bits
public getBits ( ) : integer
return integer

getRounds() public method

Method to get the rounds
public getRounds ( ) : integer
return integer

getSalt() public method

Method to get the salt
public getSalt ( ) : string
return string

setBits() public method

Method to set the cost
public setBits ( integer $bits = 512 ) : self
$bits integer
return self

setRounds() public method

Method to set the rounds
public setRounds ( integer $rounds = 5000 ) : self
$rounds integer
return self

setSalt() public method

Method to set the salt
public setSalt ( string $salt = null ) : self
$salt string
return self

verify() public method

Method to verify the hashed value
public verify ( string $string, string $hash ) : boolean
$string string
$hash string
return boolean

Property Details

$bits protected_oe property

Bits
protected int $bits
return integer

$rounds protected_oe property

Rounds
protected int $rounds
return integer

$salt protected_oe property

Salt
protected string $salt
return string