Posted By

fugue on 12/29/06


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

bsteadman


Generate random password


 / Published in: Perl
 

  1. srand(time ^ $$);
  2.  
  3. for ($n = 1; $n <= 6; $n++) {
  4. $ch = 65+rand(26);
  5. if (rand() > 0.5) {
  6. $ch += 32;
  7. }
  8. $pw .= chr($ch);
  9. }

Report this snippet  

You need to login to post a comment.