Skip to content

Instantly share code, notes, and snippets.

@blluv
blluv / s-rand.py
Created September 24, 2023 14:09 — forked from integeruser/s-rand.py
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):