I had implement login traccar from this Link but why hashed not same and always return false ?
code:
$email = $this->param['email'];
$password = $this->param['password'];
$qselect ='SELECT u.id as uid, u.name as uname, u.hashedPassword as hashed,u.salt,u.admin
FROM users u INNER JOIN users us ON us.id = u.id WHERE us.email = "'.$email.'"';
$row = $this->mysqli->query($qselect)->fetch_array();
$key = $this->hexToStr(trim($row['salt']));
$hashed = hash_pbkdf2("sha1",$password, $key,1000,24,true);
echo $this->strToHex($hashed)."---".$row['hashed']."-----".$row['salt'];
var_dump(trim($this->strToHex($hashed))==trim($row['hashed']));
exit();
if ($this->strToHex($hashed)==$row['hashed']){
$_SESSION['loginstate'] = 1;
echo 1;
}else{
echo 0;
}
the result is D33DCA55ABD4CC5BC76F2BC0B4E63FE2C6F61F4C1EF2D47---D33DCA55ABD4CC5BC76F2BC0B4E603FE2C6F61F4C1EF2D47-----000000000000000000000000000000000000000000000000bool(false)
As you can see the only different is one number only when result hash from db is 63 and result hash from generate hash_pbkdf2 is 603, the different is zero, any problem can I fix?