Hi there,
I'm trying to "convert" an unsigned int32 to an array of bytes (with a length of 4, of course). Everything i tried up to now didn't work out, so I would really appreciate any help or tip ;-)
My idea is that an uint32 has a length of 4 bytes, and thus it should be possible to take these bytes on their own and do something with them.
Short example:
uint32 contains the (dec) value 439041101, which is in hex 1A2B3C4D.
All I want is an array of 4 char's or bytes with the values:
ret[0]: 1A
ret[1]: 2B
ret[2]: 3C
ret[3]: 4F
(hex-value [and not a string])
Many thanks in advance,
phiber
I'm trying to "convert" an unsigned int32 to an array of bytes (with a length of 4, of course). Everything i tried up to now didn't work out, so I would really appreciate any help or tip ;-)
My idea is that an uint32 has a length of 4 bytes, and thus it should be possible to take these bytes on their own and do something with them.
Short example:
uint32 contains the (dec) value 439041101, which is in hex 1A2B3C4D.
All I want is an array of 4 char's or bytes with the values:
ret[0]: 1A
ret[1]: 2B
ret[2]: 3C
ret[3]: 4F
(hex-value [and not a string])
Many thanks in advance,
phiber
Comment