New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

generate-snowflake

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generate-snowflake

✨ Generate unique IDs

0.0.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

✨ Generate Snowflake

Generate unique IDs. Inspired by Twitter's Snowflake system.

📦 Installation

  • Using yarn: yarn add generate-snowflake
  • Using npm: npm install generate-snowflake

🤓 Usage

// ES6
import { Snowlfake } from "generate-snowflake";

// CommonJS
const { Snowflake } = require("generate-snowflake");

// Initialize an instance
const EPOCH = Date.now(); // Your projects EPOCH
const snowflakeInstance = new Snowflake(EPOCH);

// Generate ID
const snowflake = snowflakeInstance.generate();

🧦 Contributing

Fell free to use GitHub's features.

FAQs

Package last updated on 08 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts