> >
> > $hex = 0xff;
> > $bin = unpack("B32", pack("N", hex $hex));
>
> The above assumes big-endian byteorder. For little-endian use
> "V" instead
> of "N". Or just use "L" when the file has the same byteorder as the
> machine you are running this script on.
>
> Btw, the hex() above is probabl
On Mon, Aug 18, 2003 at 07:34:41AM -0400 Kipp, James wrote:
> > I have a file cointaing 1024 hex numbers .
> > I want to convert them to Bin.
> > Please help
>
> try something like this:
>
> $hex = 0xff;
> $bin = unpack("B32", pack("N", hex $hex));
The above assumes big-endian byteorder. For
> hi ,
> I have a file cointaing 1024 hex numbers .
> I want to convert them to Bin.
> Please help
try something like this:
$hex = 0xff;
$bin = unpack("B32", pack("N", hex $hex));
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
hi ,
I have a file cointaing 1024 hex numbers .
I want to convert them to Bin.
Please help
$out = sprintf "%o", unpack("N", pack("B32", substr("0" x 32 . $in,
-32)));
dec2bin:
$out = unpack("B*", pack("N", $in));
dec2hex:
$out = unpack("H8", pack("N", $in));
dec2oct:
$out = sprintf "%o"
thanks!
- Original Message -
From: "simran" <[EMAIL PROTECTED]>
To: "billy" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 10:11 AM
Subject: Re: help:how to hex2bin,bin2hex,bin2dec,dec2bin
> perldoc -f pac
perldoc -f pack
perldoc -f unpack
On Sun, 2038-01-17 at 12:55, billy wrote:
> are there some commands or function?
> thanks for your response.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
are there some commands or function?
thanks for your response.