-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetSalt.php
More file actions
executable file
·31 lines (29 loc) · 887 Bytes
/
getSalt.php
File metadata and controls
executable file
·31 lines (29 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
function generateRandomString($length = 10)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomString;
}
function generateRandomLetterString($length = 10)
{
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomString;
}
session_start();
ob_clean();
if ($_GET["d"] == "y")
unset($_SESSION['salt']);
if (!isset($_SESSION['salt']))
$_SESSION['salt'] = generateRandomLetterString(1024);//rand(1, 99999999999);
echo $_SESSION['salt'];
session_write_close();
//unset($_SESSION['salt']);
?>