Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/generateUniqueID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ const CUSTOM_EPOCH = 1546300800000; // 01-01-2019
const MAX_MACHINE_ID = (1 << 12) - 1;

interface Config {
/**
* Defaults to 1546300800000 (01-01-2019). This is UNIX timestamp in ms
*/
customEpoch?: number;
/**
* Defaults to false. If set to true, the returned ids will be of type BigInt or else of type string
*/
returnNumber?: boolean;
/**
* A value ranging between 0 - 4095. If not provided then a random value will be used
*/
machineID?: number;
}

Expand Down