Skip to content

Instance ID & Sequence number length #27

@tnqzh123

Description

@tnqzh123

According to Wikipedia, Snowflake ID is consisted by 31 bits timestamp, 10 bits Instance ID and 12 bits Sequence number. But you have 12 bits Instance ID and 10 bits Sequence number in nodejs-snowflake. Is this intended?

/// INSTANCE_ID_BITS is the total number of bits that
/// are occupied by the node id
const INSTANCE_ID_BITS: u64 = 12;
/// SEQUENCE_BITS is the total number of bits that
/// are occupied by the sequence ids
const SEQUENCE_BITS: u64 = 10;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions