0.0.5 • Published 9 months ago

@deloz/snowflake v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@deloz/snowflake

A TypeScript library for generating Snowflake IDs.

Snowflake is a distributed unique ID generation algorithm, commonly used to generate unique identifiers in distributed systems. This library provides a TypeScript class that makes it easy to generate Snowflake IDs.

Language Versions

Installation

Install using npm:

npm install @deloz/snowflake --save

Usage

import Snowflake from "@deloz/snowflake";

// Create an instance of Snowflake with custom datacenter ID, machine ID, and epoch
const snowflake = new Snowflake(datacenterId, machineId, "2023-01-01");

const id = snowflake.generateId();
console.log(id); // Output the generated Snowflake ID

Issues and Support

If you encounter any issues or have questions, feel free to raise them in the Issues section on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago