Here you can find the source of randomHexOfLong(long max)
public static String randomHexOfLong(long max)
//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))); } }