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-12 17:56

I M LARNIN TO SCEME
(define all "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")
(define len (string-length all))

(define (jib x)
  (define (jab n cs)
    (if (= n 0)
        cs
        (jab (- n 1) (cons (string-ref all (random len)) cs))))
  (jab (* x 100) '()))

(list->string (jiv 100000))

takes about 550ms in Ikarus
(while the exact same thing, with all defined as a list of chars and using list-ref runs around 2000ms. Wtf.)

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