Skip to content

Instantly share code, notes, and snippets.

@ChildishGiant
Created September 21, 2016 14:56
Show Gist options
  • Save ChildishGiant/bf39d195dbdc9093417bc8f5b85b57e8 to your computer and use it in GitHub Desktop.
Save ChildishGiant/bf39d195dbdc9093417bc8f5b85b57e8 to your computer and use it in GitHub Desktop.
A simple script to generate seeds for The Binding of Isaac: Rebirth
import random
__author__ = 'SolarPolarMan'
# https://twitter.com/solarpolarman
# https://www.youtube.com/solarpolarman
# https://steamcommunity.com/id/solarpolarman
# https://www.reddit.com/user/SolarPolarMan/
def getchecksum(seed):
checksum = 0
while True:
checksum = (checksum + (seed & 0xFF)) & 0xFF
checksum = (2 * checksum + (checksum >> 7)) & 0xFF
seed >>= 5
if seed == 0:
break
return checksum
def makeseed():
seed = random.randint(1, 4294967295)
checksum = getchecksum(seed)
abc = "ABCDEFGHJKLMNPQRSTWXYZ01234V6789"
seedsprev = ((seed ^ 0xFEF7FFD) << 8) | checksum
finalseed = ""
for loopindex in range(0, 8):
finalseed = abc[seedsprev & 0x1F] + finalseed
seedsprev >>= 5
return finalseed
print(makeseed())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment