Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: converting artibrary binary data to numeric values

by Corion (Pope)
on Oct 01, 2012 at 20:17 UTC ( #996736=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Data::Dumper;
    my $str = "\x0D\x0E\x0A\x0D\x0B\x0E\x0E\x0F";
    ...
    
    my $num = unpack 'N', pack 'C4', @bytes;
    print sprintf "%08x (%i)", $num, $num;
    
  2. or download this
    my $str = "\xDE\xAD\xBE\xEF";
    my $num = unpack 'N', $str;
    print sprintf "%08x (%i)", $num, $num;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-07-12 14:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls