Skip to content

Pad generated ids to full width #3

@simonratner

Description

@simonratner

If generated id can be represented with fewer than 56 bits, the returned buffer and corresponding string representation is shorter than 64 bits. This makes ids non-sortable.

Test case:

var simpleflake = require('simpleflake')
simpleflake(simpleflake.options.epoch + 1, 1)  // <Buffer 80 00 01>

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