@iimm/shared
Version:
shared utils on browser and react env
11 lines (9 loc) • 489 B
JavaScript
import { customAlphabet } from 'nanoid';
var urlAlphabet = 'useandom26T198340PX75pxJACKVERYMINDBUSHWOLFGQZbfghjklqvwyzrict';
/** Generate secure URL-friendly unique ID(由数字和字母构成).
By default, the ID will have 21 symbols to have a collision probability similar to UUID v4
* @param size — Size of the ID. The default size is 21.
* @return — A random string.
*/
var nanoid = customAlphabet(urlAlphabet, 21);
export { customAlphabet as customNanoidAlphabet, nanoid };