Skip to main content

SnowflakeID

Overview

A basic implementation of Twitter's original Snowflake ID system.

Usage

import { SnowflakeID } from 'keywork/ids'

Constructors

constructor

new SnowflakeID

(options?)

Parameters

NameType
optionsObject
options.mid?number
options.offset?number

Defined in

ids/SnowflakeID.ts:28

Methods

generate

generate

(): `string`

Returns

string

Defined in

ids/SnowflakeID.ts:35