16 lines
388 B
PHP
16 lines
388 B
PHP
<?php
|
|
function getSalt() {
|
|
$charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/\\][{}\!@#$*()_=+';
|
|
$randString = "";
|
|
$randStringLen = 128;
|
|
|
|
while(strlen($randString) < $randStringLen) {
|
|
$randChar = substr(str_shuffle($charset), mt_rand(0, strlen($charset)), 1);
|
|
$randString .= $randChar;
|
|
}
|
|
|
|
return $randString;
|
|
}
|
|
|
|
?>
|