Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function generateRandomString($length) {
- $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
- $randomString = '';
- for ($i = 0; $i < $length; $i++) {
- $randomString .= $characters[rand(0, strlen($characters) - 1)];
- }
- return $randomString;
- }
- $salt = generateRandomString(16);
- $sha = 'SHA';
- $hash = hash('sha256', hash('sha256', $pass1) . $salt);
- $encrypt = '$' . $sha . '$' . $salt . '$' . $hash;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement