Converting Little Endian Byte Array To Long
Posted on 2003-11-22
I would like to know how to convert a Little Endian byte array to a long value. I already have a code for Big Endian to Long:
For i = LBound(ByteArray) To UBound(ByteArray)
Return = ShiftLeft(Return, 8) + ByteArray(i)
ShiftLeft is a function which shifts a value n bits to the left (SHL ; <<).
For Little Endian to Long, I am currently using a loop, which will "mirror" an array and then pass it to the Big Endian to Long function, but that is slow - especially when there are lots of items.
I thought there might be some built in functions or APIs which could accelerate the whole process.