getOptions(); return \scrypt($password, $options['salt'] ?? null, $options['cost_cpu'], $options['cost_memory'], $options['cost_parallel'], $options['length']); } /** * @param string $password Input password to validate * @param string $hash Hash to verify password against * * @return boolean true if password matches hash */ public function verify(string $password, string $hash): bool { return $hash === $this->hash($password); } /** * Get default options for specific hashing algo * * @return mixed options named array */ public function getDefaultOptions(): mixed { return [ 'cost_cpu' => 8, 'cost_memory' => 14, 'cost_parallel' => 1, 'length' => 64 ]; } }