I am using http://www.openwall.com/phpass/ for hashing. I wish to add namespace to it, and added the single line as shown below.
<?php
namespace myNameSpace; //I added this one line
class PasswordHash {
//...
}
?>
I then create my object, however, when I apply the HashPassword method, the results are totally different.
require 'PasswordHash.php';
//$t_hasher = new PasswordHash(8, FALSE); //Original line
$t_hasher = new myNameSpace\PasswordHash(8, FALSE);
$correct = 'test12345';
$hash = $t_hasher->HashPassword($correct);
The only changes were the two lines where I added the namespace to the class and were I initiated the object.
What could cause the differences and how can identify and fix them?