Link to home
Start Free TrialLog in
Avatar of Sebastian_Mares
Sebastian_Mares

asked on

Converting Little Endian Byte Array To Long

Greetings!

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)
Next 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.

Sebastian Mares
ASKER CERTIFIED SOLUTION
Avatar of Z_Beeblebrox
Z_Beeblebrox

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial