Here you can find the source of randomHexOfInt(int min, int max)
public static String randomHexOfInt(int min, int max)
//package com.java2s; //License from project: Apache License public class Main { public static String randomHexOfInt(int min, int max) { int randomInt = randomIntWithMinMax(min, max); return Integer.toHexString(randomInt); }/*ww w . j ava2 s. c o m*/ public static String randomHexOfInt(int max) { int randomInt = randomIntWithMinMax(0, max); return Integer.toHexString(randomInt); } public static int randomIntWithMinMax(int min, int max) { return (int) (min + (Math.random() * (max - min + 1))); } }