Crispy String
A simple tool that creates random base 10, 16, 32, 62 and 64 strings. Very useful to give random ids to objects or to give a unique filename to any uploaded file when you just want it to be unique and sanitized.
Installing.
npm install crispy-string
Basic example.
Creating a string with just decimals and a length of 8 characters is as simple as:
var crispy = ; crispy;
Methods.
base10String(length)
Creates a random decimal string
Character pool: Digits
crispy; // => '98145208'
base16String(length)
Creates a random hexadecimal string
Character pool: Digits, Uppercase A to F
crispy; // => 'A81FB209'
base32String(length)
Creates a random base 32 string:
Character pool: Digits, Uppercase A to Z
crispy; // => 'a81Fb2cz'
base62String(length)
Creates a random base 62 string
Character pool: Digits, Uppercase A to Z and Lowercase a to z
crispy; // => 'ab82dE0X'
base64String(length)
Creates a random base 64 string
Character pool: Digits, Uppercase A to Z, Lowercase a to z, + and /
crispy; // => 'x8/dFB0+'