Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Handling binary

by flexvault (Monsignor)
on Sep 12, 2015 at 13:52 UTC ( #1141775=note: print w/replies, xml ) Need Help??


in reply to Handling binary

Welcome G109B,

I think you will find it easier to use binary strings for your project. To get you started:

perl -e '$h=pack("H*","139686DA20C1");$b=unpack("B*",$h);print length( +$b)," $b\n";'

Then use 'substr' to get 5 binary digits at a time.

while( $b ) { print substr($b,0,5,""); }
Do the opposite to build your blob.

Why are you using Base 5, when the rest of the world uses binary?

Regards...Ed

"Well done is better than well said." - Benjamin Franklin

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2020-09-19 03:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (114 votes). Check out past polls.

    Notices?