vanilla javascript ArrayBuffer / DataView version of Python's struct module