I have a hex buffer in Node js like this:
buffer <00 E0>
I need to convert to int using little endianess. So I would read E0 00 -> 57344
For the moment I use this method:
var str = "0x" + buffer [i] .toString ('16 '). toString + buffer [i-1] .toString ('16'). toString to convert to string
var result = parseInt (str).
This method works but sometimes I get errors like this: buffer [0] = 00 but I receve 0 instead 00 or 1 instead to 01 or 10,
Is there another way to get this convertons or to solve this problem?
Thank you