broofa/node-uuid — Issue #24: Uniqueness of v1 UUIDs if msecs is set.
Author: ctavan
Created: 2011-12-18 11:24:14+00:00
State: open

While implementing node-uuid with node-cassandra-client I came across this test written by the node-cassandra-client authors: https://github.com/ctavan/node-cassandra-client/blob/node-uuid/test/test_uuid.js#L13-29

It fails with node-uuid since setting `msecs` bypasses the internal clockseq-counter. What was the particular reason for you to put it that way? The only reason I can see is code readability.

Reading through the RFC again, IMO setting `msecs` and `nsecs` to a value in the future and then to a value lower than that future-value can just be interpreted as "setting the clock backwards". So unless the `clockseq` is explicitly specified I think node-uuid should take care of setting the clockseq according to the RFC (and not the calling application, which would be necessary at the moment).

I admit that this will add complexity to the v1 logic, but still I think it would be more in the sense of the RFC... What are your thoughts?