Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: I'm looking for the faster way to convert char 2 Bin and Bin 2 char (8bits)

by Fixer (Acolyte)
on Jan 26, 2001 at 03:28 UTC ( [id://54424]=note: print w/replies, xml ) Need Help??


in reply to I'm looking for the faster way to convert char 2 Bin and Bin 2 char (8bits)

To get the byte (char) representation of a bit string:
$char = pack("b8","01010101");
To get the bit_string of a char/byte:
$bit_string = unpack("b8",$char);
  • Comment on Re: I'm looking for the faster way to convert char 2 Bin and Bin 2 char (8bits)

Replies are listed 'Best First'.
Re: Re: I'm looking for the faster way to convert char 2 Bin and Bin 2 char (8bits)
by DarkGoth (Acolyte) on Jan 26, 2001 at 13:25 UTC
    Thanx, that was exactly what i looked for ;)~~~~

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://54424]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found