in reply to H2 pack/unpack not working for negative numbers
I think what you are looking for is one of...
perl -le 'print unpack("c", pack("c", -1))' perl -le 'print unpack("i", pack("i", -1))'
H2 means 2 hex strings, which are unsigned. i and/or c work with numbers, and hex/decimal/etc. are transparent to them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: H2 pack/unpack not working for negative numbers
by Qckng (Initiate) on Dec 10, 2003 at 19:20 UTC | |
by BrowserUk (Patriarch) on Dec 10, 2003 at 20:19 UTC | |
by Anonymous Monk on Dec 10, 2003 at 23:44 UTC | |
by BrowserUk (Patriarch) on Dec 11, 2003 at 00:00 UTC | |
by duff (Parson) on Dec 10, 2003 at 20:15 UTC |