c - Alpha-numeric Random number generator for Apache module -


i need random number generator apache module in c, generates alpha-numeric values. tried apr_generate_random_bytes() , whole suite of apr_random functions in here, - characters 0-255, need characters represent 0-9 , a-z a-z in ascii.

this leaves range of 10 + 26 + 26 = 62 characters, pretty close 64, conveniently power of 2. make array of 64 character entries alphanumeric values , 2 additional characters (- , _, maybe? otherwise repeat other numbers), convenient number of random bytes, read 7 bits @ time , use character given in lookup table.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -