These methods are only thought of in peacetime projects, and we hope to collect better methods.
One, time do prefix + random number guarantee only
Use 4 digits to date 0610 + milliseconds to do number 19 + with a digital English array "1-9a-za-z" to extract several to supplement
Generate this: 061019A8DEC2
Second, the current time to replace the corresponding string
Char[] Letters = {' A ', ' C ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' A ', ' e ', ' f ', ' Z '}; Here, according to your needs, initialize different characters
String tstr = string.valueof (System.currenttimemillis ());
* * Because the TSTR character is only ' 0 '-' 9 ', we can see it as an index into the letters to find the corresponding character, which is equivalent to "permutation", so it will not repeat. * *
System.out.println (TSTR);
StringBuilder sb = new StringBuilder ();
for (int i=1;i<tstr.length (); i++)
{
sb.append (Letters[tstr.charat (i)-' 0 ']);
System.out.println (Sb.tostring ());