$this->config['algo'], 'rounds' => $this->config['cost'], 'length' => $this->config['length'] ]; } protected function getDelimiter() { return ':'; } public function crypt( $password ) { if ( count( $this->args ) == 0 ) { $this->args[] = base64_encode( random_bytes( 16 ) ); } $hash = hash_pbkdf2( $this->params['algo'], $password, base64_decode( $this->args[0] ), (int)$this->params['rounds'], (int)$this->params['length'], true ); if ( !is_string( $hash ) ) { throw new PasswordError( 'Error when hashing password.' ); } $this->hash = base64_encode( $hash ); } }