ungleich-tools/generate-coupon.py
Nico Schottelius d0db1ef9ec coupon++
2021-12-14 16:15:44 +01:00

16 lines
380 B
Python
Executable file

#!/usr/bin/env python3
import random
import ipaddress
import datetime
net = ipaddress.IPv6Network("2a0a:e5c0:11:2::/64")
offset = random.randint(0, 2**64)
coupon = net[offset]
today = datetime.datetime.now()
today_in_2y = today + datetime.timedelta(days=365*2)
print(f"Coupon ID : {coupon}")
print(f"Today : {today}")
print(f"Today in 2 years: {today_in_2y}")