Name:
Anonymous
2008-08-19 8:01
$file_id = $db->escape_string(md5_file($file));
Name:
Anonymous
2008-08-19 8:24
Quite good, actually.
define("PASS", "Site wide totally random stuff to use as a salt. Hammer on your keyboard for 30 seconds, please.");
define("passHashingIters", 512);
function passhash($password, $raw = true)
{
$p = str_split(PASS);
$pl = strlen(PASS);
if (passHashingIters > 1) {
for ($i = 0; $i !== passHashingIters - 1; ++$i) {
$password = hash('sha512', $password . $p[$i%$pl], true);
}
}
return hash('sha512', $password, $raw);
}
How about this?