Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Generating alphanumeric gibberish?

Name: Anonymous 2010-01-12 14:58

What's a simple (preferably loopless) way to generate a large amount of alphanumeric gibberish? Any language is acceptable.

In PHP, I thought this would be perfect:

hexdec(mt_rand(1.e999999999, 1.e9999999999));

But it doesn't work due to restrictions on the length of int. :(

Name: Anonymous 2010-01-15 21:59

ENTERPRISE C IMPLEMENTATION

#include <stdio.h>
#include <time.h>

char characters[] = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghjklmopqrst";
char gibberish[1];

int main()
{
    srand(time(NULL));
    int x;
   
    for (x = 0; x <= 300; x++) gibberish[x] = characters[rand() % 54];
    for (x = 0; x <= 300; x++) printf("%c", gibberish[x]);
   
    return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List