Answer the question
In order to leave comments, you need to log in
Why does the sha256 value change after writing to the database?
Hashing
$hash = hash( 'sha256', $newlogin . $newpass . $salt );
"INSERT INTO `admin` ( `login`, `passhash` ) VALUES ( '$newlogin', '$hash' );"
Answer the question
In order to leave comments, you need to log in
You are checking incorrectly: you need to display the generated value, add it to the database and see what was added to the database.
It is possible in more detail how rows are formed:
hash from db:
generated hash:
?
Look closely at the generated hash:
Is $salt randomly generated by any chance? then it converges - you have a new value for each operation
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question