Last active
August 29, 2015 14:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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