#!/usr/bin/env python3
import hmac, hashlib, os, sys

def secret():
    return 'T2M' + chr(35) + 'wCp' + chr(64) + '2O26' + chr(36) + 'pRo' + chr(33) + 'Key'

def generate_key():
    part1 = os.urandom(4).hex().upper()
    h = hmac.new(secret().encode('utf-8'), part1.encode('utf-8'), hashlib.sha256).hexdigest()
    part2 = h[:8].upper()
    return f"WCPP-{part1}-{part2}"

count = int(sys.argv[1]) if len(sys.argv) > 1 else 1
count = max(1, min(count, 500))

print("\nWoocom-Pay Pro — License Key Generator")
print("─" * 42)
print()
for _ in range(count):
    print(generate_key())
print(f"\n{count} key(s) generated. Keep these safe — each key activates one Pro license.\n")
