Closed Hellblazer closed 2 years ago
Ok thanks; hope to read this later today... sounds like there may be quite a bit to digest again :)
No worries. I’m likely just doing something obviously silly.
Ok, so, my head is hurting wrt bit/byte shuffling code so I'll check that another day.
But I did notice one problem: code assumes that Variant 7 uses 100nsec granularity, like existing time-based variant 1 (and new 6). But as far as I can read, spec says that V7 uses millisecond granularity for simplicity. This is the reason why those 12 bits of randomness are needed to pad up things.
So, this complicates changes to UUIDTimer
a bit; it may be that getTimestamp()
method just needs to be mostly copied into getTimestampV7()
. That's not a big deal I am guessing. But refactoring it to minimize duplication may result in more awkward code.
Other than that looks good; I hope to look more into this within next couple days; at latest on Juneteenth when I might have a Free OSS Coding Day for a change. :)
Think this should be correct now.
@Hellblazer I do believe this is correct! Good job & apologies once again for unreliable follow-up.
I'll try to re-re-read once over and the only thing I'll probably try to change is figure out how that Random
sharing ought to work. But that's a trivial detail.
Implements #46.