. */ /** * Adapter for PHPass. * * @since 4.6.0 * @package Password */ namespace Textpattern\Password\Adapter; class PasswordHash implements \Textpattern\Password\AdapterInterface { /** * Stores an instance of PHPass. * * @var \PasswordHash */ private $phpass; /** * Constructor. */ public function __construct() { $this->phpass = new \PasswordHash(PASSWORD_COMPLEXITY, PASSWORD_PORTABILITY); } /** * {@inheritdoc} */ public function verify($password, $hash) { return $this->phpass->CheckPassword($password, $hash); } /** * {@inheritdoc} */ public function hash($password) { return $this->phpass->HashPassword($password); } }