I imagine this is a really dumb question, but is there some standard simple code for generating the next largest number in hexadecimal format? I need to generate sequential alphanumeric passwords. There must be some standard simple way to do this. - SA
Are you asking how to format an integer as a hex value? If so, just use the Integer wrapper class and call the static method toHexString(). That will take an int, and return a String formatted in hex notation.
Originally posted by Sylvia Allen: I need to generate sequential alphanumeric passwords. There must be some standard simple way to do this. - SA
I found the easiest way was to just create an array of all the acceptable characters in the password: char[] passChars = {'A', 'a', ..... '9'}; Then just generate random numbers that range from 0 to 1 less than the length of the array and use that as an index into the array. Need a password of 8 characters? Generate 8 random numbers and pull 8 random characters from your array.