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

Re^2: pack/unpack 6-bit fields. (precision)

by tye (Sage)
on Aug 18, 2004 at 07:10 UTC ( #383881=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    bytes:  765432 10 7654 3210 76 543210
    fields: 543210 54 3210 5432 10 543210
    or
    bytes:  012345 67 0123 4567 01 234567
    fields: 012345 01 2345 0123 45 012345
    
  2. or download this
    my @fields=
         unpack "C*",    # 16 6-bit numeric values
    ...
         unpack "B6"x16, # 16 6-character base-2  strings
         pack   "C*",    # string of 16 bytes, each  holding a 6-bit value
         @fields;        # 16 6-bit numeric values
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://383881]
help
Chatterbox?
[Lady_Aleena]: LanX, I just never thought I would be explaining perl regex to others. It is usually others explaining why a regex isn't working to me.
[Discipulus]: congratulations shmem! (was my last upvote? ;=)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2017-04-28 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (520 votes). Check out past polls.