Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pad generated ids to full width #3

Open
simonratner opened this issue Nov 24, 2015 · 0 comments
Open

Pad generated ids to full width #3

simonratner opened this issue Nov 24, 2015 · 0 comments

Comments

@simonratner
Copy link
Owner

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant