mirror of
https://github.com/SrIzan10/randomemail.git
synced 2026-06-06 01:06:49 +00:00
15 lines
438 B
JavaScript
15 lines
438 B
JavaScript
function randomstring(length) {
|
|
let result = '';
|
|
const characters = 'abcdefghijklmnopqrstuvwxyz';
|
|
const charactersLength = characters.length;
|
|
let counter = 0;
|
|
while (counter < length) {
|
|
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
counter += 1;
|
|
}
|
|
return result;
|
|
}
|
|
export default function randomEmail() {
|
|
return `${randomstring(13)}@${randomstring(12)}.com`;
|
|
}
|