in reply to Re^4: sprintf %X endianness
in thread sprintf %X endianness
*sigh* look at the op, 00021401 is the thing
*sign* Is what "thing"?
Cos in the OP you wrote:"00021401", but in this post you wrote: 00204110 twice. Which should I take as being your requirement?
IF you are now saying that the OP is what you want, then apply yourself, because what I posted in my first response is all you need:
$raw = "\1\24\2\0";; $local = unpack 'L>', $raw;; printf "%08x\n", $local;; 01140200 $local = unpack 'L<', $raw;; printf "%08x\n", $local;; 00021401
And yes, that last pair of statements will work regardless of the platform it is run on.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: sprintf %X endianness
by Anonymous Monk on May 15, 2013 at 02:01 UTC | |
by BrowserUk (Patriarch) on May 15, 2013 at 02:43 UTC | |
by Anonymous Monk on May 15, 2013 at 03:10 UTC | |
by BrowserUk (Patriarch) on May 15, 2013 at 04:06 UTC |