-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlc.py
35 lines (25 loc) · 878 Bytes
/
lc.py
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
import settings
from datetime import datetime
import hashlib
import sys
def check_license():
constStr='telegbotlicense'
email_id=settings.EMAIL_ID
license=settings.LICENSE_KEY
now = datetime.now()
day = now.day
month = now.month
year = now.year
strToHash=constStr+str(email_id)+str(day)+str(month)+str(year)
#print(strToHash)
strToHash_b=strToHash.encode('utf-8')
hash_object = hashlib.sha1(strToHash_b)
hex_dig = hash_object.hexdigest()
#print(hex_dig)
if license==hex_dig :
return True
print("----------------------------------------")
print("LICENCE EXPIRED. CONTACT VENDOR")
print("----------------------------------------")
sys.exit()
return False