On Tue, 1 Jul 2025 15:20:07 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
>> The uniqueness comes not just from the timestamp but also from the random >> data in the other bytes that are generated for each new UUID. > > Hello Roger, that's true about the uniqueness semantics. However, from what I > understand of RFC-9562, on which this new API is based, I think it has much > stricter expectations about monotonocity (the first 48 bits) too. For > example, the following sections: > > https://www.rfc-editor.org/rfc/rfc9562.html#name-timestamp-considerations > https://www.rfc-editor.org/rfc/rfc9562.html#name-monotonicity-and-counters Indeed, the sections of the RFC mentioned by @jaikiran do require timestamps to be (strictly) monotonic. The method `monotonicMS()` does not fulfill this requirement. There are some methods described in ยง6.2 to help ensuring monotonicity. While it is true that the 74 bits of randomness help in creating unique ID with high probability, the requirements for the timestamp part in UUID Version 7 seem more restrictive than just uniqueness. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25303#discussion_r2179634215