Considering the post I've made about the sequential guid performance on Microsoft.NET framework (see What are the performance improvement of Sequential Guid over standard Guid?) does somebody have a proper, sure, fast and well working Java implementation of the same algorithm implemented in the Windows DLLs?
Regards Massimo
GUID is an acronym for Globally Unique Identifier . It is often also referred to Universally Unique Identifiers or UUIDs . There is no genuine difference between the two terms. Technically, these are 128-bit immutable, unique, cryptographically-strong, random numbers.
UUID are supposed to be in-sequential, so that someone can not predict the other value. If you need sequence then UUID is not a right choice.
UUID is a term that stands for Universal Unique Identifier. Similarly, GUID stands for Globally Unique Identifier. So basically, two terms for the same thing. They can be used, just like a product number, as a unique reference for an academic standard or content title.
The randomUUID() method is used to retrieve a type 4 (pseudo randomly generated) UUID. The UUID is generated using a cryptographically strong pseudo random number generator.
See this article: http://www.informit.com/articles/article.aspx?p=25862&seqNum=7 (linked to Page 7).
It contains an algorithm for what the author refers to as "COMB" Guids; I reproduce his code (SQL) below:
SET @aGuid = CAST(CAST(NEWID() AS BINARY(10))
+ CAST(GETDATE() AS BINARY(6)) AS UNIQUEIDENTIFIER)
Trivial to convert this to Java, or your desired language. The obvious underlying principle is to make the date a component of the Guid. The entire article is a good read, as he does a nice analysis of the performance of the various approaches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With