node-simpleflake icon indicating copy to clipboard operation
node-simpleflake copied to clipboard

Pad generated ids to full width

Open simonratner opened this issue 10 years ago • 0 comments

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>

simonratner avatar Nov 24 '15 07:11 simonratner