B bluedude Well-Known Member Licensed User Longtime User Sep 1, 2014 #1 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?
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 Sep 1, 2014 #2 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
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
Erel B4X founder Staff member Licensed User Longtime User Sep 2, 2014 #3 A long value is made of 8 bytes. You need to append 2 bytes (4 zeros) to your hex string for it to work: 000010cdc4d4a948 Upvote 0
A long value is made of 8 bytes. You need to append 2 bytes (4 zeros) to your hex string for it to work: 000010cdc4d4a948
B bluedude Well-Known Member Licensed User Longtime User Sep 2, 2014 #4 Hi, Solved it with the Java function Parselong which seems to work. Cheers and thanks! Upvote 0