Added: Random challenge for each requests (default)

This commit is contained in:
lgandx 2017-01-03 17:35:49 -03:00
parent 17dc81cb68
commit 1d38cd39af
7 changed files with 62 additions and 41 deletions

View file

@ -23,6 +23,17 @@ import time
import settings
import datetime
def RandomChallenge():
if settings.Config.NumChal == "random":
from random import getrandbits
NumChal = '%0x' % getrandbits(16 * 4)
Challenge = ''
for i in range(0, len(NumChal),2):
Challenge += NumChal[i:i+2].decode("hex")
return Challenge
else:
return settings.Config.Challenge
def HTTPCurrentDate():
Date = datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')
return Date