🚩 (flags) add username generator
generate username from full name and combine with random string.
This commit is contained in:
7
shared/helper/generateRandomString.ts
Normal file
7
shared/helper/generateRandomString.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { customAlphabet } from "nanoid";
|
||||
|
||||
export const generateRandomString = (length: number = 10): string => {
|
||||
const characters =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
return customAlphabet(characters, length)();
|
||||
};
|
||||
Reference in New Issue
Block a user