Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
method Snowflake.prototype.generate
import { Snowflake } from "https://deno.land/x/snowflakes@1.0.0/Snowflake.ts";

Generates a snowflake given an epoch and optionally a timestamp

Examples

Example 1

const epoch = new Date('2000-01-01T00:00:00.000Z');
const snowflake = new Snowflake(epoch).generate();

Parameters

optional
unnamed 0: SnowflakeGenerateOptions = [UNSUPPORTED]

options to pass into the generator, see SnowflakeGenerateOptions

note when increment is not provided it defaults to the private increment of the instance