List of utility methods to do Random Byte
byte | createRandomByte() create Random Byte return (byte) (Math.random() * 255); |
byte | generateRandomByte() generate Random Byte return (byte) (Math.random() * 0xFF); |
String | rand(int bit) rand if (bit < 1) { return ""; Random random = new Random(); Double randNumber = random.nextDouble(); return randNumber.toString().split("\\.")[1].substring(0, bit); |
int | rand(int lbound, int ubound) rand return (int) ((rand.nextDouble() * (ubound - lbound + 1)) + lbound); |
int | rand(int lo, int hi) rand int n = hi - lo + 1; int i = rn.nextInt() % n; if (i < 0) { i = -i; return lo + i; |
int | rand(int lo, int hi) rand java.util.Random rn = new java.util.Random(); int n = hi - lo + 1; int i = rn.nextInt(n); if (i < 0) i = -i; return lo + i; |
int | rand(int lo, int hi) Returns a random number that falls within the specified range int n = hi - lo + 1; int i = rn.nextInt() % n; if (i < 0) { i = -i; return lo + i; |
int | Rand(int lo, int hi) Returns an integer random number uniformly distributed between lo and hi . Random rn2 = new Random(); int n = hi - lo + 1; int i = rn2.nextInt(n); if (i < 0) { i = -i; return lo + i; |
int | rand(int max) Get a random integer less than a given value. return randomSet.nextInt(max);
|
byte | randByte() rand Byte return (byte) ((int) (Math.random() * s_RAND_MAX) & 0xff); |