ungleich-tools/generate-coupon.py

17 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}")