Skip to content

Instantly share code, notes, and snippets.

@underr
Last active August 29, 2015 14:21
Show Gist options
  • Save underr/f8c643fc484b7d321000 to your computer and use it in GitHub Desktop.
Save underr/f8c643fc484b7d321000 to your computer and use it in GitHub Desktop.
TRNG that uses 4chan's /b/ to get a random seed and display a truly random number
import basc_py4chan, random
# WARNING: this part uses pseudo-random numbers before generating the true ones.
board = basc_py4chan.Board('b')
threads = board.get_threads(page=random.randint(0,6))
random_thread = random.choice(threads)
numbers = []
nn = 1
for post in random_thread.posts:
numbers.append(post.comment)
for n in numbers:
nn += int(''.join(str(ord(c)) for c in n))
random.seed(nn)
print(random.randint(0, int(10e10)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment