mono-uuid-generator icon indicating copy to clipboard operation
mono-uuid-generator copied to clipboard

Time resolution issue for Type 1 UUID's

Open managedfusion opened this issue 14 years ago • 0 comments

I was looking at the following code:

http://github.com/tlaukkan/mono-uuid-generator/blob/master/UUIDTimer.cs#L184

The line that I highlighted will not give you a valid Time UUID, because the Environment.TickCount is the system uptime, not the elapsed time since the Gregorian Calendar started as defined in the Type 1 UUID specification.

http://msdn.microsoft.com/en-us/library/system.environment.tickcount.aspx

I think you want something more equivalent to what I did here:

http://github.com/managedfusion/fluentcassandra/blob/master/FluentCassandra/GuidGenerator.cs#L64

Hope this helps, I look forward to scrapping my GUID generator for yours in the future.

managedfusion avatar May 02 '10 15:05 managedfusion