Snowflake.Redis.CSharp 1.3.1

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

// Install Snowflake.Redis.CSharp as a Cake Tool
#tool nuget:?package=Snowflake.Redis.CSharp&version=1.3.1                

<div> <p align="center"> <image src="snowflake.png" width="250" height="250"> </p> <p align="center">An ID Generator for C# based on Snowflake Algorithm (Twitter announced).</p>

<p align="center">

<a href="https://www.nuget.org/packages/Snowflake.CSharp"> <image src="https://img.shields.io/nuget/v/Snowflake.CSharp.svg?style=flat-square" alt="nuget"> </a>

<a href="https://github.com/hueifeng/snowflake-csharp/workflows/.NET%20Core/badge.svg"> <image src="https://github.com/hueifeng/snowflake-csharp/workflows/.NET%20Core/badge.svg" alt="NETCore"> </a>

<a href="https://www.nuget.org/stats/packages/Snowflake.CSharp?groupby=Version"> <image src="https://img.shields.io/nuget/dt/Snowflake.CSharp.svg?style=flat-square" alt="stats"> </a>

<a href="https://raw.githubusercontent.com/hueifeng/snowflake-csharp/master/LICENSE"> <image src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="LICENSE"> </a>

<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fhueifeng%2Fsnowflake-csharp?ref=badge_shield"> <image src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fhueifeng%2Fsnowflake-csharp.svg?type=shield" alt="FOSSA"> </a> </p>

</div>

Description

Language: English | 中文

Twitter's SnowFlake algorithm is implemented using C# language.

Installation

PM> Install-Package Snowflake.CSharp

Useage

  1. Specify the data center ID and machine ID.
SnowFlake snowFlake = new SnowFlake(datacenterId:1,machineId:1);
  1. Generate Id.
var id = snowFlake.NextId();

Advanced

Support Kubernetes HorizontalPodAutoscaler.

  1. Used in distributed.
PM> Install-Package Snowflake.Redis.CSharp
  1. Add the following code at ConfigureServices() method.

public void ConfigureServices(IServiceCollection services)
{
  services.AddSnowflakeRedisService(connectionString:"127.0.0.1:6379,allowAdmin=true", 
      option 
            =>Configuration.GetSection("snowFlake").Bind(option)
     );
}

Distributed snowflake ID automated configuration of different machine ids.

"snowFlake": {
  "dataCenterId": 1,
  "Name": "test"
} 

License

Apache

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.3.1 132 8/30/2024
1.3.0 569 6/16/2022
1.2.9 9,183 11/19/2021
1.2.8 375 11/19/2021
1.2.7 391 11/19/2021
1.2.6 405 11/19/2021
1.2.5 356 11/19/2021
1.2.4 366 11/19/2021
1.2.3 376 11/19/2021
1.2.2 349 11/18/2021
1.2.1 315 11/18/2021
1.2.0 995 8/13/2021
1.1.1 385 5/31/2021
1.1.0 528 12/5/2020
1.0.0 2,758 6/27/2020