You need to generate a unique string, such as a build application identification, that can be implemented directly with the Java.util.UUID class.
The UUID (universally unique Identifier) Globally unique identifier, which is the number generated on a single machine, guarantees that all machines in the same space-time are unique.
The UUID consists of a combination of the following parts:
1, the current date and time , the first part of the UUID is related to time, and if you generate a UUID after a few seconds after generating an UUID, the first part is different and the rest is the same.
2, clock sequence
3, the globally unique IEEE Machine identification number (if there is a network card, obtained from the network card, no network card in other ways to obtain).
The only drawback to the UUID is that the resulting string will be longer.
You can get a unique string by calling the following methods.
UUID uuid = Uuid.randomuuid (); String s = Uuid.randomuuid (). toString ();
The UUID consists of a 16-digit number, produced in the form of a string such as: 9291d71a-0354-4d8e-acd8-64f7393c64ae.
If the identity is applied, replace the '-' alternative to null by using a string method, and the string form, such as 9291d71a03544d8eacd864f7393c64ae, can be obtained.