short-uuid
short-uuid copied to clipboard
Add support for UUID v7
This is an interesting idea. I think with some minor rework short-uuid
could accept any uuid generator as a source.
This may be the target of the v6 release.
In the meantime, you can create a uuidv7 translator with just a few lines of code.
import short from 'short-uuid'
import { uuidv7 } from 'uuidv7';
const translator = short();
const v7Short = {
...translator,
new: () => translator.fromUUID(uuidv7()),
generate: () => translator.fromUUID(uuidv7()),
uuid: uuidv7,
};
export default Object.freeze(v7Short);