RandomHelloACM

Generate random using web service into ASP variable.
With help of PHP, we now have another way to generate random strings, needed to create random ID for most of my web applications
Originally from https://helloacm.com/random/

If you want to prevent it from creating ID starts with zero (like I do), replace RandomHelloACM.php code
 for ($i = 0; $i < $length; $i++) {
  $randomString .= $characters[rand(0, $charactersLength - 1)];
 }
With
 for ($i = 0; $i < $length; $i++) {
  $Char1 = $characters[rand(0, $charactersLength - 1)];
  while ($i == 0 && $Char1 == '0') {
   $Char1 = $characters[rand(0, $charactersLength - 1)];
  }
  $randomString .= $Char1;
 }


Public

Tested

My Own Work

Leng, Upper, Lower, Digits, SpcChars

Views 4610 Downloads 1480