-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.py
More file actions
37 lines (33 loc) · 1.05 KB
/
Copy pathfunctions.py
File metadata and controls
37 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from cryptograph import Encrypt
import random
class Functions:
def VerifyPassword(password,type: str):
if type.upper() == "C":
datafile = "customer"
elif type.upper() == "E":
datafile = "employee"
else:
raise Exception("Account Type Mentioned in Invalid")
with open(f"data/{datafile}.txt",'r') as f:
data = f.readlines()
Verified = False
for i in data:
if Encrypt(password) in i:
Verified = True
return Verified
def findAccNo(cust_id):
with open('data/accounts.txt','r') as file:
data = file.readlines()
for i in data:
if cust_id in i:
acc = i.split()[0]
file.close()
return acc
def verify_captcha():
i = random.randrange(10000,99999)
print("Captcha: ",i)
x = int(input("Enter the given Captcha: "))
if x == i:
return True
else:
return False