mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +00:00
10 lines
309 B
TypeScript
10 lines
309 B
TypeScript
export function generateOTP(): string {
|
|
// Generate a random number between 0 and 999999
|
|
const randomNumber = Math.floor(Math.random() * 1000000);
|
|
|
|
// Pad the number with leading zeros if necessary to ensure it is always 6 digits
|
|
const otp = randomNumber.toString().padStart(6, "0");
|
|
|
|
return otp;
|
|
}
|