Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of the time-based UUID #3

Open
arichiardi opened this issue Feb 18, 2014 · 0 comments
Open

Implementation of the time-based UUID #3

arichiardi opened this issue Feb 18, 2014 · 0 comments

Comments

@arichiardi
Copy link

Hello Stephen,
I was looking at your implementation of the version 1 (time-based) UUID and I had a read of the RFC4122.
I was interested in using your library but I think it still requires some work (at the moment I can't help you with it I am sorry).
My idea was to keep the other two "shared state" described below in memory (with the possibility to store it to disk) together with what you already have:

From a system-wide shared stable store (e.g., a file), read the
UUID generator state: the values of the timestamp, clock sequence,
and node ID used to generate the last UUID.

So three fields instead of one. It would be great to have the possibility to completely skip the MAC polling and get a pseudo-random sequence as described below:

The exact algorithm to generate a node ID using these data is system
specific, because both the data available and the functions to obtain
them are often very system specific.  A generic approach, however, is
to accumulate as many sources as possible into a buffer, use a
message digest such as MD5 [4] or SHA-1 [8], take an arbitrary 6
bytes from the hash value, and set the multicast bit as described
above.

Where the sources could be passed in by clients.
I had a quick peek at your UUIDGen and it looks like you merge Node ID and clockSeqAndNode (line 194). Maybe I am not reading it right...
Ok, let me know what you think...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant