Cola.SnowFlake 3.0.0

dotnet add package Cola.SnowFlake --version 3.0.0
                    
NuGet\Install-Package Cola.SnowFlake -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cola.SnowFlake" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cola.SnowFlake" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Cola.SnowFlake" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cola.SnowFlake --version 3.0.0
                    
#r "nuget: Cola.SnowFlake, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Cola.SnowFlake&version=3.0.0
                    
Install Cola.SnowFlake as a Cake Addin
#tool nuget:?package=Cola.SnowFlake&version=3.0.0
                    
Install Cola.SnowFlake as a Cake Tool

ColaSnowFlake 雪花ID

1. 配置文件配置
"ColaSnowFlake": {
  "DatacenterId": 1,
  "WorkerId": 1
}
2. 注入方式
//通过配置文件注入
builder.Services.AddSingletonSnowFlake(config);
// 直接注入
builder.Services.AddSingletonSnowFlake(option =>
{
    option.DatacenterId = 1;
    option.WorkerId = 1;
});
3. 使用方式
//生成雪花Id
var long = IColaSnowFlake.CreateSnowFlakeId();

//解析雪花ID 解析后的字符串格式: datetime_datacenterId_workerId_sequence
string str = IColaSnowFlake.AnalyzeId(long snowFlakeId);
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Cola.SnowFlake:

Package Downloads
Cola.Core

Cola.Core.

Cola.Log

Cola.Log.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.0 276 3/8/2025
2.0.0 254 3/7/2025
1.1.0 248 3/7/2025