Skip to content

Commit 4f0581b

Browse files
authored
Merge pull request #274 from Rancho2002/feat-modify
Added python-script for generate OTP
2 parents e7bac23 + 63de434 commit 4f0581b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import random
2+
def otp(num):
3+
result=""
4+
if(len(str(num))==10):
5+
for i in range(6):
6+
digit=str(random.randint(0,9))
7+
result=result+digit
8+
return result
9+
else:
10+
s="Enter a valid mobile number!"
11+
return s
12+
13+
print(otp(9874453920))

scripts/otp_generator/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# OTP GENERATOR
3+
4+
In this project, a 6 digit OTP will be auto generated when user gives a valid 10 digit mobile number. This is written in python and can be implemented in websites as well for authentication.
5+

0 commit comments

Comments
 (0)