xid
uses the URL-friendly Crockford Base32 encoding with CRC-8 checksum to generate random identifiers that are tolerant to inaccurate human inputs.
$ npm install --save xid
var xid = require("xid");
var id = xid.generateId();
// do something with generated ID...
// validate user input
try {
xid.validate(id);
} catch (err) {
// id is invalid
}
// normalize user input
try {
id = xid.normalize(id);
} catch (err) {
// id is invalid
}
Apache 2.0