
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
PHP | size: 0.30 KB | hits: 33 | expires: Never
<?php
function encrypt($password)
{
$characters = 'ABCDEFHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$salt = '';
for ($i = 0; $i < 5; ++$i)
{
$salt .= $characters[rand(0, strlen($characters) - 1)];
}
return array (hash('sha512', $password.$salt), $salt);
}
?>