34 'algo' => $this->config[
'algo'],
35 'rounds' => $this->config[
'cost'],
36 'length' => $this->config[
'length']
44 public function crypt( $password ) {
45 if ( count( $this->args ) == 0 ) {
46 $this->args[] = base64_encode( random_bytes( 16 ) );
50 $this->params[
'algo'],
52 base64_decode( $this->args[0] ),
53 (
int)$this->params[
'rounds'],
54 (
int)$this->params[
'length'],
57 if ( !is_string(
$hash ) ) {
61 $this->hash = base64_encode(
$hash );