public function testHashPassword() { $hasher = new PasswordHash(8, true); $testPassword = '******'; for ($i = 0; $i < 10; $i++) { $hash = $hasher->HashPassword($testPassword); $this->assertTrue($hasher->CheckPassword($testPassword, $hash)); } }
/** * Encode a raw password. * * @param string $raw * @return string */ public function hashPassword($raw) { return $this->phpass->HashPassword($raw); }
protected function execute(InputInterface $input, OutputInterface $output) { $raw = $input->getArgument('raw'); $hash = $this->phpass->HashPassword($raw); $output->writeln('<info>Generated hash:</info> ' . $hash); }