using System.Collections.Generic;
using System.Security.Cryptography;
private const int ITERATIONS = 100000;
HashSet<long> _ids = new HashSet<long>();
long min = long.MaxValue;
long max = long.MinValue;
for (int i = 0; i < ITERATIONS; i++)
Console.WriteLine($"Min: {min}");
Console.WriteLine($"Max: {max}");
Console.WriteLine($"Unique IDS: {_ids.Count}/{ITERATIONS}");
Console.WriteLine($"Collisions: {collisions}");
private static long GenerateKey()
byte[] bytes = new byte[2];
RNGCryptoServiceProvider.Create().GetBytes(bytes);
uint counter = BitConverter.ToUInt16(bytes, 0);
long now = DateTime.Now.Ticks;
long id = (now << 16) | counter;