/** * Tests the hash for the security component * * @author Nikos Dimopoulos <*****@*****.**> * @since 2013-03-02 * @requires extension openssl */ public function testHash() { $security = new \Phalcon\Security(); for ($i = 8; $i < 12; $i++) { $hash = $security->hash('a', $i); $this->assertTrue($security->checkHash('a', $hash)); } for ($i = 8; $i < 12; $i++) { $hash = $security->hash('aaaaaaaaaaaaaa', $i); $this->assertTrue($security->checkHash('aaaaaaaaaaaaaa', $hash)); } }
public function validatePassword($tryPassword) { $security = new \Phalcon\Security(); return $security->checkHash($tryPassword, $this->password); }