temp
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { customAlphabet } from 'nanoid';
|
||||
import { createId } from '@paralleldrive/cuid2';
|
||||
|
||||
export const letter = 'abcdefghijklmnopqrstuvwxyz';
|
||||
export const number = '0123456789';
|
||||
const alphanumeric = `${letter}${number}`;
|
||||
export const alphanumericWithDash = `${alphanumeric}-`;
|
||||
|
||||
export const cuid2 = createId;
|
||||
/**
|
||||
* 创建一个随机的字母字符串
|
||||
*/
|
||||
@@ -12,12 +15,12 @@ export const uuid = customAlphabet(letter);
|
||||
/**
|
||||
* 创建一个随机的 id,包含字母和数字
|
||||
*/
|
||||
export const nanoid = customAlphabet(alphanumeric, 10);
|
||||
export const nanoid = customAlphabet(alphanumeric, 16);
|
||||
|
||||
/**
|
||||
* 创建一个随机的 id,包含字母、数字和短横线
|
||||
*/
|
||||
export const nanoidWithDash = customAlphabet(alphanumericWithDash, 10);
|
||||
export const nanoidWithDash = customAlphabet(alphanumericWithDash, 16);
|
||||
|
||||
/**
|
||||
* 创建一个随机的 id,以字母开头的字符串
|
||||
|
||||
Reference in New Issue
Block a user