Skip to content

Instantly share code, notes, and snippets.

@Tombert
Last active February 3, 2016 22:28
Show Gist options
  • Save Tombert/46dddd2268b47a661a6d to your computer and use it in GitHub Desktop.
Save Tombert/46dddd2268b47a661a6d to your computer and use it in GitHub Desktop.
RandCat
#! /usr/bin/python3
import calendar
import time
seed = calendar.timegm(time.gmtime()) # We'll use the epoch time as a seed.
def random (seed):
seed2 = (seed*297642 + 83782)/70000
return int(seed2) % 70000;
p = seed
while True: # if we're going with a mimicing of cat /dev/random, it'll pretty much just go until it's killed
p = random(p)
print(chr(p % 256), end="")
p = p % 4000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment