Skip to content

Instantly share code, notes, and snippets.

@BenWiederhake
BenWiederhake / md4.py
Created July 22, 2018 17:45 — forked from bonsaiviking/md4.py
Simple MD4 digest implementation in pure Python
#!/usr/bin/env python3
# Based on https://gist.github.com/bonsaiviking/5644414
# Converted to Python3 by hand.
import codecs
import struct
def leftrotate(i, n):
return ((i << n) & 0xffffffff) | (i >> (32 - n))
@BenWiederhake
BenWiederhake / 95voices.py
Created February 6, 2016 16:44
Sentence splicer simulating a crowded head with lots of voices
#!/usr/bin/env python2
# 95voices.py, sentence splicer simulating a crowded head with lots of voices
# This work is in the Public Domain, as per:
# http://creativecommons.org/licenses/publicdomain/
import random
from sys import argv
usage = '''Usage:
./95voices.py "This is a coherent sentence." \\
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
/ige_demo
@BenWiederhake
BenWiederhake / circ.lisp
Last active December 17, 2015 04:09
An extremely simple, dumb, slow, but wonderfully easy-to-use circuit simulator and verifier in roughly 450 "actual" lines of code.
; Install lisp:
;; aptitude install sbcl emacs slime
; Open emacs, and load program:
;; M-x slime
; Now play around:
;; (load "path/to/circ.lisp")
;; (example-1)
;; (example-2)