Skip to content

Instantly share code, notes, and snippets.

@integeruser
integeruser / s-rand.py
Last active September 24, 2023 14:09
Python port of the GLIBC rng
#!/usr/bin/env python2
from ctypes import c_int, c_uint
# http://www.mscs.dal.ca/~selinger/random/
def srand(seed):
srand.r = [0 for _ in range(34)]
srand.r[0] = c_int(seed).value
for i in range(1, 31):