getOptions(); return \scrypt($password, $options['salt'] ?? null, $options['costCpu'], $options['costMemory'], $options['costParallel'], $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 array options named array */ public function getDefaultOptions(): array { return [ 'costCpu' => 8, 'costMemory' => 14, 'costParallel' => 1, 'length' => 64 ]; } }