Here I use Java provided by the Java.util.UUID class to generate random strings, UUID code is what I will not repeat, can meet our needs.
Here is the Java code:
1 ImportJava.util.UUID;2 3 Public classTest {4 5 PrivateString getId () {6UUID UUID =Uuid.randomuuid ();7 returnUuid.tostring (). Replace ("-", "" ");8 }9 Ten Public Static voidMain (string[] args) { One for(inti = 1; I <= 10; i++) { ASystem.out.println ("+i+" secondary cycle: "+NewTest (). GetId ()); - } - /* the * 1th cycle: d93d954031ba46f189218b70fb515e81 - 2nd cycle: 39bb777fc3174d3eae567af9c36e9b91 - 3rd cycle: 004cf5d069f242fdaeadb0c3b617a177 - 4th cycle: 1a34a35b3819435a9bf3cf57e84723e3 + 5th cycle: 36bddeeb80cf474692ebb2a820143ac4 - 6th cycle: 14118998dcfb434888fb89cfe86872f6 + 7th cycle: 23d13d893163462e83c735ddeed70324 A 8th cycle: Ac5ea675f91c418cae8b30372d4197a6 at 9th cycle: Fd139e9da15e4b51a8341ae46b6fbdec - 10th cycle: 3f8b227e2f514160a0e0f7abb6fe63db - */ - } -}
With simple processing, we can randomly get a 32-character string.
Java generates a unique ID