Custom nanoid generate functions with predefined character sets. Uses nanoid-dictionary as a dictionary.
Install nanoid-generate
npm i nanoid-generate -S
Then pick a desired generator and set its' output string length
const generate = require('nanoid-generate');
const englishRandomString = generate.english(10);
Or instead require a specific generator
const nolookalikes = require('nanoid-generate/nolookalikes');
const nolookalikesRndString = nolookalikes(10);
Numbers from 0 to 9
const numbers = require('nanoid-generator/numbers');
Lowercase English letters.
const englishLowercase = require('nanoid-generator/lowercase');
Uppercase English letters.
const englishUppercase = require('nanoid-generator/uppercase');
Uppercase and lowercase English letters with numbers.
const alphanumeric = require('nanoid-generator/alphanumeric');
English alphabet.
const englishUppercase = require('nanoid-generator/english');
Numbers and english alphabet without lookalikes: 1
, l
, I
, 0
, O
, o
, u
, v
const nolookalikes = require('nanoid-generator/nolookalikes');