Tuesday, 15 March 2011

java - Getting a random number without the Random library -



java - Getting a random number without the Random library -

i random numbers between range give, problem don't want utilize random library of java or have initializate.

does know alternative way random numbers without using java library?

thanks

edit: think solution?

int random = + (int)(system.currenttimemillis()%((j - i) + 1));

where , j range

you have implement own pseudo-random number generation algorithm, literally reinventing wheel , not secure!

another solution utilize service generates true random numbers like random.org

java dll random

No comments:

Post a Comment