PDU parser and generator written in javascript