short-uuid
Generate and translate standard UUIDs into shorter - or just different - formats and back.
v2.1.3
2.1.0 adds Browserify config to support client-side use as proposed by voronianski.
2.1.1 includes compiled browser-ready files in the npm package for convenience. The library is exposed as ShortUUID
.
2.1.2 switches to the modular uuid
library.
2.1.3 fixes a bad npm package for 2.1.1 which included Snyk incorrectly.
v2.1.2 Unpublished
An incorrect package.json was packaged in v2.1.2, causing Snyk to be listed as a dependency.
This was introduced in v2.2.0.
short-uuid provides RFC4122 v4-compliant UUIDs,
thanks to uuid
.
var short = require('short-uuid');
var translator = short();
var decimalTranslator = short("0123456789");
var cookieTranslator = short(short.constants.cookieBase90);
translator.new();
short.uuid();
translator.uuid();
translator.toUUID(shortId);
translator.fromUUID(regularUUID);
translator.alphabet
short.constants.flickrBase58;
short.constants.cookieBase90;
v2.1.3 is under 1K when compressed. Using Browserify, the library and dependencies are less than 4K.
Please see Revisions for information on previous versions.