Quantcast
Channel: password_hash function in php 5.5 - Stack Overflow
Viewing all articles
Browse latest Browse all 3

password_hash function in php 5.5

$
0
0

i have the following function that hashes a password and stores it in a database. i am trying to use the password_hash function in php 5.5 but its giving me weird results.

function hashpass($password){    include("includes/config.php");    $password = password_hash($password, PASSWORD_DEFAULT);    return $password;}

I then output the result for the same static password which i am just testing as "testpassword" and it keeps giving me different hashes. Why is that? if it keeps doing that i will never be able to verify the password because it will never yield the same hash for the exact same string.

Is there something that i need to configure or set before hand for this to work correctly?


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>