This is a lightweight implementation of Twitter's Snowflake algorithm on .NET platform. The library consists of only one class IdFactory, which is pretty much equal to IdWorker. However, there are still few main differences:
- When generating new ID, the
IdFactoryclass employs spin lock instead of mutex to have faster performance. - The default constructor of
IdFactoryclass will extract local IP addresses as its worker ID and data center ID. - Codes and exception messages are adjusted to follow C# coding conventions.