diff --git a/lib/to-buffer.js b/lib/to-buffer.js index ef0d4d4..1679248 100644 --- a/lib/to-buffer.js +++ b/lib/to-buffer.js @@ -1,12 +1,64 @@ var Buffer = require('safe-buffer').Buffer +function swapBytes(buf, size) { + var bytes = new Uint8Array(buf.slice()); + var len = bytes.length; + var holder; + + if (size == 2) { + //16 bit + for (var i = 0; i