Selasa, 05 Oktober 2010

Create sequetial UUID

I got a lot of interesting answers for the riddle, and here is my solution:private static int sequentialUuidCounter;public static Guid CreateSequentialUuid(){    var ticksAsBytes = BitConverter.GetBytes(DateTime.Now.Ticks);    Array.Reverse(ticksAsBytes);    var increment = Interlocked.Increment(ref sequentialUuidCounter);    var currentAsBytes = BitConverter.GetBytes(increment);    Array.Reverse

Tidak ada komentar:

Posting Komentar