Any equivalent of Yii CPasswordHelper?

I would like to store a hashed password in the database but by that time I haven’t load Yii yet (due to my custom application installer). I want to know the equivalent of


in PHP. SO far I have tried with the PHP


function like this:

password_hash(filter_input(INPUT_POST, 'portal_password', FILTER_SANITIZE_STRING), PASSWORD_BCRYPT, array("cost" => 13));

The result comes out like:


but when I tried to login with my original password, it failed. I notice that often the result of CPasswordHelper::hashPassword has


but mine has


prefix. Anyone could help? Thanks!

Before CPasswordHelper was added into Yii, I was using this class using the blowfishSalt method. Possibly worth checking out.

Actually my approach was working fine :) It is another irrelevant mistake somewhere else that cause the login failed. Hope someone might find this useful and thank you for your time!