here I've got a small collection of Random generators rebuild from C source code or from scratch with the help of pseudo code algorithms and I dare to say that they are usable.  However the source is openly available you have to keep in mind that these are demonstrations.  For a thorough explanation of the algorithms I've provided a link in each article.  To build the examples you can use the makefile below or, even better, download them at Github.


BIN=congruentialrng xorshift MT19937-32

NASM=/usr/bin/nasm
NASMOPTS=-felf64 -Fdwarf
LDOPS=-melf_x86_64 -g

.PHONY: all clean

all: $(BIN)

clean:
	rm -rf $(BIN)

%: %.asm
	$(NASM) $(NASMOPTS) -o $@.o $<
	$(LD) $(LDOPS) -o $@ $@.o
	rm -f $@.o