Created
July 9, 2019 16:25
-
-
Save bertrand-lupart/7a7c39dc572fe4d2cbf27b111975c98b to your computer and use it in GitHub Desktop.
Generate random printable strings using Pike
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string random_printable_string(int size) | |
{ | |
string rand = ""; | |
for(int i=0; i<size; i++) | |
rand += String.int2char(random(94)+32); | |
return rand; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ls Rand.pmod
Rand.pmod
$ pike -M .
Pike v8.0 release 702 running Hilfe v3.5 (Incremental Pike Frontend)