HerobrineTV / SMM1-Level-Downloader

A Super Mario Maker 1 Level Downloader designed for the Use of the WayBackMachines Level Collection
MIT License
18 stars 0 forks source link

[FEATURE] Add Possibility to Search via SMM1 Level IDs #43

Closed HerobrineTV closed 7 months ago

HerobrineTV commented 7 months ago

Based on this Python Code I can create them from the normal ID Its easier to create the normal id out of them, but maybe I need the other way also later so I safe it here:

import struct import hashlib import hmac idno = int(input("Enter level ID from database: ")) key = hashlib.md5(b"9f2b4678").digest() data = struct.pack("<Q", idno) checksum = hmac.HMAC(key, data, 'md5').digest() checksum = checksum[3:1:-1].hex().upper() idstring = str.upper(hex(idno))[2:] for y in range(8 - len(idstring)): idstring = '0' + str(idstring) code = str(checksum) + '0000' + str(idstring) print(code)

HerobrineTV commented 7 months ago

Added in #41 s Branch