node-simpleflake
node-simpleflake copied to clipboard
Pad generated ids to full width
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>