Reputation: 1
I need to figure out why I get the wrong results, here is the thing:
Expected result
Mu0FBjARVsNyDiixnKqyLCCqVunTSPQFCMnOwGQsIWliY2Jh
Current Result
MzJlZDA1MDYzMDExNTZjMzcyMGUyOGIxOWNhYWIyMmMyMGFhNTZlOWQzNDhmNDA1MDhjOWNlYzA2NDJjMjE2OQ==
The code I'm using (php)
echo base64_encode(hash("sha256", $pass.$salt'));
This site http://www.insidepro.com/hashes.php giveme a preety closer result
sha256($pass.$salt) => Mu0FBjARVsNyDiixnKqyLCCqVunTSPQFCMnOwGQsIWk=
you can find (in the site, near the result field) a [1], that means "Hash in Base64"
the thing is... I can't even get the sites result
EDIT (Thanks Jon)
now the code goes like this
echo base64_encode(hash("sha256", $pass.$salt', true));
I'm getting the same result as in the site
the problem now is the difference between the two results
actual result : Mu0FBjARVsNyDiixnKqyLCCqVunTSPQFCMnOwGQsIWk=
expected result : Mu0FBjARVsNyDiixnKqyLCCqVunTSPQFCMnOwGQsIWliY2Jh
Upvotes: 0
Views: 1581