private function randomString($length = -1)
{
// Determine if the length should be random
if ($length < 0) {
$length = mt_rand(1, 1024);
}
// Generate the random string from the below character set
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ';
$charactersLength = strlen($characters);
$randomString = '';
foreach (range(1, $length) as $i) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}