Java UUID Generator (JUG), uuidjug
UG is a Java-only UUID generator.
UUID refers to the number generated on a machine, which ensures that all machines in the same time and space are unique. Generally, the platform provides APIs for UUID generation. UUID is calculated according to the standards set by the Open Software Foundation (OSF), and uses Ethernet Card addresses, nanoseconds, chip ID codes, and many possible numbers. The combination of the following parts: the current date and time (the first part of UUID is related to the time. If you generate a UUID in seconds, the first part is different and the rest are the same), the clock sequence, and the globally unique IEEE machine identification number (if there is a network card, it is obtained from the network card, and no network card is obtained in other ways ), the unique defect of UUID is that the generated result string is long. The most common UUID standard is Microsoft's GUID (Globals Unique Identifiers ).
The project home page: http://jug.safehaus.org/
What is UUID? How does one generate UUID in Java?
GUID is a 128-bit long number, which is generally expressed in hexadecimal notation. The core idea of an algorithm is to combine the machine's Nic, local time, and a random number to generate a GUID. Theoretically, if a machine generates 10000000 guids per second, it can ensure (in probability) that there will be no duplicates in 3240.
UUID is a new class in 1.5. in java. util, it can generate a globally unique ID.
Import java. util. UUID;
Public class Test {
Public static void main (String [] args ){
UUID uuid = UUID. randomUUID ();
System. out. println (uuid );
}
}
What is the uuid in java? How does one execute a method to return a non-repeated string or number each time?
String id = UUID. randomUUID (). toString (). replace ("-","");
A 128-bit long number, usually expressed in hexadecimal notation
Generate a 32-bit string, which is generally used as the primary key of the table.
UUID. randomUUID (). toString (); format:
550E8400-E29B-11D4-A716-446655440000