ShiroFlake 1.0.1

dotnet add package ShiroFlake --version 1.0.1                
NuGet\Install-Package ShiroFlake -Version 1.0.1                
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="ShiroFlake" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ShiroFlake --version 1.0.1                
#r "nuget: ShiroFlake, 1.0.1"                
#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.
// Install ShiroFlake as a Cake Addin
#addin nuget:?package=ShiroFlake&version=1.0.1

// Install ShiroFlake as a Cake Tool
#tool nuget:?package=ShiroFlake&version=1.0.1                

ShiroFlake

ShiroFlake is a distributed unique ID generator inspired by on Twitter's Snowflake

ShiroFlake by default using same parameter that used in Twitter's Snowflake.

A ShiroFlake ID is composed of

41 bits for time in units
12 bits for a machine id
10 bits for a sequence number

But you can set the unsigned parameter to true at initialization the generator to use full 64 bit.

var generator = new ShiroFlakeGenerator(
    1, // machine id
    unsigned: true);

As a result, ShiroFlake has the following advantages:

  • The lifetime (~139 years if unsigned is true) is longer than that of Snowflake (69 years)
  • It can work in more distributed machines (2^12) than Snowflake (2^10)
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 134 4/24/2024