Open-source lightweight Snowflake ID generator
$ dotnet add package DistributedId.SnowflakeOpen-source lightweight Snowflake ID generator
services.AddSnowflakeId(configure =>
{
configure.GroupId = context.Configuration.GetValue<ushort>("SnowflakeIdGenerator:GroupId");
configure.MachineId = context.Configuration.GetValue<ushort>("SnowflakeIdGenerator:MachineId");
});
var snowflakeId = ServiceProvider.GetRequiredService<ISnowflakeId>();
var id = snowflakeId.NewId();