Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function randHash($length) {
- $hash = '';
- if ($length>2) {
- $alphabet = str_split('qwertyuiopasdfghjklzxcvbnm');
- for($i = 0; $i < 2; $i++) {
- $hash .= $alphabet[array_rand($alphabet)];
- }
- $length-=2;
- }
- $alphabet = str_split('qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890');
- for($i = 0; $i < $length; $i++) {
- $hash .= $alphabet[array_rand($alphabet)];
- }
- return $hash;
- }
- $key = md5($_POST['address'] . ' ' . randHash(rand(10, 12)));
- $_SESSION["key"] = $key;
- $claim_url .= '&key=' . rawurlencode($key);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement