mirror of
https://github.com/akazwz/smail.git
synced 2026-05-06 22:01:09 +08:00
Refactor email generation to use alphanumeric suffix instead of numeric-only; extract nanoid alphabet configuration to module-level constant for reusability and change suffix from digits-only to lowercase letters and numbers.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import randomName from "@scaleway/random-name";
|
||||
import { customAlphabet } from "nanoid";
|
||||
|
||||
const nanoSuffix = customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 6);
|
||||
|
||||
export function generateEmailAddress() {
|
||||
return `${randomName()}-${customAlphabet("1234567890", 6)()}@smail.pw`;
|
||||
return `${randomName()}-${nanoSuffix()}@smail.pw`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user