Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
baderj committed Jan 12, 2020
1 parent 255ee6b commit 8d6bbce
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions monerodownloader/dga.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
magic = "jkhhksugrhtijys78g46"
special = "31b4bd31fg1x2"


def dga(date, back=0):
epoch = datetime(1970, 1, 1)
days_since_epoch = (date - epoch).days
Expand All @@ -23,21 +24,19 @@ def dga(date, back=0):
seed = "{}-{}-{}".format(magic, days, nr)
m = hashlib.md5(seed.encode('ascii')).hexdigest()
mc = m[:13]

if nr == 0:
sld = special
else:
sld = mc

domain = "{}{}".format(sld, tld)

yield domain
days -= 1


if __name__=="__main__":
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--date", help="date for which to generate domains")
parser.add_argument("-d", "--date", help="date when domains are generated")
args = parser.parse_args()
if args.date:
d = datetime.strptime(args.date, "%Y-%m-%d")
Expand Down

0 comments on commit 8d6bbce

Please sign in to comment.