Output-to-seed mappings for CPython's PRNG
4 points by cceckman
4 points by cceckman
I guess it makes sense that CPython would not want to replace their PRNG for backwards compat reasons (although it's not like they're averse to breaking changes...), but man, it is wild that they're still using a Mersenne Twister.
Shades of Tristan Miller's The Great Commodore/Microsoft Easter
Egg War (TPUG newsletter, Fall 2015) which claims that there are easter eggs hidden in Commodore BASIC's RND function:
10 a=125708:gosub 20:a=33435700:gosub20:
a=17059266:gosub 20:end
20 a=rnd(-a)
30 a=int(rnd(a)*22):if a then print chr$
(a+64);:goto30
40 print:return
ready.
run
bill
gates
sucks
ready.
The 100 heads seed is 4.88kb! I think the next challange is finding a smaller seed that puts the PRNG into the same state.
I already have Mersenne Twister on the Python Iceberg a little below the water line , but I guess I should make a new entry for finding the seed further down in its depths.