snowyflake
Version:
A modern implementation Snowflake on TypeScript
21 lines (20 loc) • 789 B
TypeScript
export declare const Epoch: {
Unix: bigint;
Twitter: bigint;
Discord: bigint;
};
export declare const DEFAULT_VALUE = 0n;
export declare const DEFAULT_SEQUENCE = 0n;
export declare const USIGNED_INCREASE = 1n;
export declare const SIGNED_INCREASE = -1n;
export declare const WORKER_ID_BITS = 5n;
export declare const PROCESS_ID_BITS = 5n;
export declare const SEQUENCE_BITS = 12n;
export declare const WORKER_ID_DECONSTRUCT_MASK = 4063232n;
export declare const PROCESS_ID_DECONSTRUCT_MASK = 126976n;
export declare const WORKER_ID_MASK: bigint;
export declare const PROCESS_ID_MASK: bigint;
export declare const SEQUNCE_MASK: bigint;
export declare const TIMESTAMP_LEFT_SHIFT: bigint;
export declare const WORKER_ID_SHIFT: bigint;
export declare const PROCESS_ID_SHIFT = 12n;