ref: https://github.com/maraoz/browserify-buffertools/blob/master/buffertools.js#L57