Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Hex String XOR

by alanonymous (Sexton)
on Mar 12, 2012 at 08:22 UTC ( #959080=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
        my @ar = $t1 =~ /(..)/g;
        foreach (@ar) {
  2. or download this
        my $hexor = unpack('h*',pack('h*',$t1) ^ pack('h*',$t2));
  3. or download this
    my $hhh = unpack('h*',pack('h*',"20") ^ pack('h*',"61")); #xor ' ' and
    + 'a' should result in 'A'
        print unpack('h*',$hhh);
  4. or download this
    sub parse () {
        my $t1 = $txt1->Contents();

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://959080]
Approved by Corion
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2015-07-04 13:14 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (60 votes), past polls