Chinese | English
SnowFlake is a useful software package based on the open source SnowFlake algorithm created by RT-Thread.
Snowflake algorithm is an algorithm invented by Twitter. The main purpose is to solve the problem of how to generate ID in distributed environment.
Mandatory requirements for the distributed ID generation rule:
-
Globally unique;
-
It is essential that no duplicate ID numbers appear, since they are unique.
For more software package introduction, please refer to Detailed introduction.
The directory structure of the SnowFlake software package is as follows:
SnowFlake
├───docs
│ ├───figures // Documents use pictures
│ │ api.md // API instructions
│ │ introduction.md // Introduction document
│ │ principle.md // Implementation principle
│ │ README.md // Document structure description
│ │ samples.md // package sample
│ │ user-guide.md // Instructions
│ └───version.md // version
├───inc // header file
├───samples // sample code
│ └───snowflake_sample // gets the ID sample code
├───src // source file
│ LICENSE // package license
│ README.md // Software package instructions
│ SConscript // RT-Thread default build script
│ snowflake.h // snowflake header file
│ snowflake_port.c // snowflake_port source file
└───snowflake_port.h // snowflake_port header file
The SnowFlake software package complies with the MIT license, see the LICENSE file for details.
- RT_Thread 3.0+
To use the SnowFlake software package, you need to select it in the RT-Thread package management. The specific path is as follows:
RT-Thread online packages
tools packages --->
[*] Snowflake algorithm is a distributed ID generation algorithm
[ ] Enable snowflake samples
Version (latest) --->
-
For detailed description of the software package, please refer to Introduction
-
For detailed sample introduction, please refer to Sample Document
-
How to use from scratch, please refer to User Guide
-
For complete API documentation, please refer to API Manual
-
The working principle of the software package, please refer to Working Principle
-
More Detailed introduction documents are located in the
/docs
folder, Please check before using the package for development.
Note If you need to change the configuration, follow the precautions in introduction
-
Maintenance: 2022alpha
-
Open Source Address: https://github.com/yitter/IdGenerator