Skip to content
Advertisement

java- how to generate a 6 digit random hexadecimal value

I have a scenario in a Android app, where a random hexadecimal value has to be generated with 6 digits. (The range of values can be hexadecimal or integer values).

What is the most efficient way to do this? Do I have to generate a random decimal number, and then convert it to hexadecimal? Or can a value be directly generated?

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement