Java Random Long randomHexOfLong(long max)

Here you can find the source of randomHexOfLong(long max)

Description

random Hex Of Long

License

Apache License

Declaration

public static String randomHexOfLong(long max) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String randomHexOfLong(long max) {
        long randomInt = randomLongWithMinMax(0, max);
        return Long.toHexString(randomInt);
    }/*ww  w. java 2 s .  c  om*/

    public static long randomLongWithMinMax(long min, long max) {
        return (long) (min + (Math.random() * (max - min + 1)));
    }
}

Related

  1. randLong(long n)
  2. random(long begin, long end)
  3. random(long max)
  4. random(long min, long max)
  5. random(long range)
  6. randomLong()
  7. randomLong()
  8. randomLong(long min, long max)
  9. randomLong(long x, long y)