Skip to content

wanjun-cn/MyStack.SnowflakeId

Repository files navigation

MyStack.SnowflakeIdGenerator

Open-source lightweight Snowflake ID generator

nuget stats
nuget stats

Getting Started

Add Service Support

services.AddSnowflakeId(configure =>
{
    configure.GroupId = context.Configuration.GetValue<ushort>("SnowflakeIdGenerator:GroupId");
    configure.MachineId = context.Configuration.GetValue<ushort>("SnowflakeIdGenerator:MachineId");
});

Generate a new Snowflake Id

var snowflakeId = ServiceProvider.GetRequiredService<ISnowflakeId>();
var id = snowflakeId.NewId();

License

MIT

About

开源的轻量级生成雪花Id

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors