Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SleepyMode/Snowflake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

Snowflake

C++ header-only Implementation of Twitter's Snowflake algorithm.

Terminology

  • Instances are referred to as "Machine Identifiers" (.machineId)
  • Sequences are referred to as "Worker Identifiers" (.workerId)

Usage

Sample usage can be found in test.cc. Make sure to initialize the library with SnowflakeId::initialize prior to using (w/ epoch and machine identifier).

Example:

int main(int argc, char* argv[], char* envp[])
{
	SnowflakeId::initialize(0, 50);
	SnowflakeId identifier = SnowflakeId::generate();
	std::cout << identifier.implode() << std::endl;
}

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /