snowyflake / Snowyflake
- deconstruct
- generateCustomId
- nextId
- deconstruct
- deconstructProcessId
- deconstructSequence
- deconstructTimestamp
- deconstructWorkerId
• new Snowyflake(__namedParameters?
)
Constructor
Name | Type |
---|---|
__namedParameters |
ISnowyflakeOptions |
• Readonly
epoch: bigint
Snowflake start epoch
• Private
latestTimestamp: bigint
Latest timestamp
• Readonly
processId: bigint
Internal process ID
• Private
sequence: bigint
= DEFAULT_SEQUENCE
Sequence increment for process
• Readonly
workerId: bigint
Internal worker ID
▸ deconstruct(snowflake
): IDeconstructedSnowflake
Deconstruct the Snowflake with local epoch
Name | Type |
---|---|
snowflake |
bigint |
▸ generateCustomId(__namedParameters
): bigint
Generate a custom Snowflake
Name | Type |
---|---|
__namedParameters |
ISnowyflakeGenerateCustomIdOptions |
bigint
▸ nextId(): bigint
Generate a Snowflake
bigint
▸ Static
deconstruct(snowflake
, __namedParameters
): IDeconstructedSnowflake
Deconstruct the Snowflake
Name | Type |
---|---|
snowflake |
bigint |
__namedParameters |
ISnowyflakeDeconstructOptions |
▸ Static
deconstructProcessId(snowflake
): bigint
Deconstruct the Snowflake processId
Name | Type |
---|---|
snowflake |
bigint |
bigint
▸ Static
deconstructSequence(snowflake
): bigint
Deconstruct the Snowflake sequence
Name | Type |
---|---|
snowflake |
bigint |
bigint
▸ Static
deconstructTimestamp(snowflake
, epoch
): bigint
Deconstruct the Snowflake timestamp
Name | Type |
---|---|
snowflake |
bigint |
epoch |
bigint |
bigint
▸ Static
deconstructWorkerId(snowflake
): bigint
Deconstruct the Snowflake workerId
Name | Type |
---|---|
snowflake |
bigint |
bigint