Re: [nodejs] NodeJS Buffer Endianess is all wrong

2014-02-27 Thread AlainM
I agree! Just a bit more: TCP headers are big-endians and "payload" is dont-care as long as you know how to get them on the other side Note: I wrote a tcp/ip for DOS. I needed a function to swap endianness (intel is little-endian)... Fedor Indutny escreveu: >Hello! > >I think you are a bit co

Re: [nodejs] NodeJS Buffer Endianess is all wrong

2014-02-27 Thread Fedor Indutny
Hello! I think you are a bit confused about endians and buffer representation in console. When you type `myBuff` it prints bytes in the same order as they'll be sent on network or written to file. i.e. `` means that `buf[0] === 0x36` and `buf[1] === 0x02`, which is exactly how Little Endian shoul

[nodejs] NodeJS Buffer Endianess is all wrong

2014-02-27 Thread jduncanator
Correct me if I'm wrong but I think there is an issue with the way Buffer's endianness works (or at least the "description" the methods have). Lets say I create a new buffer: var myBuff = new Buffer(4); And now I wish to write an integer to my buffer in little-endian which has the least signif