A rough JavaScript version of BINSCII