Android Question Bytes to long with byteconverter

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

I want to get from this 10cdc4d4a948 (hex) to this 18475956611400 (long).

Tried using below:

data = bc.HexToBytes ("10cdc4d4a948")
longID = bc.LongsFromBytes (data)

The longs from bytes array is zero, any suggestions?

Should actually be working, used it the other way around: long to bytes hexfrombytes. Missing something?
 

udg

Expert
Licensed User
Longtime User
Hi BlueDude,

according to ByteConverter library's documentation, function LongsFromBytes returns an array.
Specifically:
"Takes an array of Bytes and returns an array of Longs converted from that array."

udg
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

Solved it with the Java function Parselong which seems to work.

Cheers and thanks!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…