Open-source lightweight Snowflake ID generator
nuget | stats |
---|---|
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();
MIT