Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a string of hexadecimal numbers like
$a = '9b23b4b322b0da70';
and I want to convert it to a binary string. Is there a simple way to do this using pack() or vec()? currently I am thinking of splitting the string every two characters, and doing chr() on each of them, but I think this is probably not the best way, is it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: packing hex
by rob_au (Abbot) on Dec 30, 2003 at 08:54 UTC | |
|
Re: packing hex
by Taulmarill (Deacon) on Dec 30, 2003 at 09:00 UTC | |
|
Re: packing hex
by davido (Cardinal) on Dec 30, 2003 at 17:05 UTC |