I have a hash function on sa-mp
new MyHash[256];
SHA256_PassHash(inputtext, "78sdjs86d2h", MyHash, sizeof(MyHash));
if(!strcmp(MyHash, PlayerInfo[playerid][pKey]))
I assume 78sdjs86d2h is the salt, but how do I set the salt in PHP?
I am using this code, and it hashes but not with my salt.
if(isset($_POST['username']) && isset($_POST['password'])){
mysql_query('SET NAMES utf8');
$var = mysql_real_escape_string("\xbf\x27 OR 1=1 /*");
$username = mysql_real_escape_string($_POST['username']);
$parola = mysql_real_escape_string($_POST['password']);
$hash = hash('sha256', $parola);
$check = get_row("SELECT ID FROM players WHERE Name='$username' && password='$hash' LIMIT 1");
if(isset($check['ID']))
{
$_SESSION['username'] = $_POST['username'];
$_SESSION['password'] = $_POST['password'];
$id = $check['ID'];
header("location: index.php");
}
else
{
printf("%s", $hash);
$err = 'Username sau parola incorecte';
}
}
How do I make it hash with my own salt?