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

Re^2: Hex String XOR

by Marshall (Prior)
on Mar 12, 2012 at 09:21 UTC ( #959094=note: print w/ replies, xml ) Need Help??

in reply to Re: Hex String XOR
in thread Hex String XOR

I think this is good as far as it goes, but I would assume that the OP wants to XOR some humongous things that cannot be represented as simple Perl numeric scalar values? In this case, use hex() function.

my $x = "aabbcc"; my $y = "112233"; printf '%x', hex($x) ^ hex($y); #bb99ff
This causes integer overflow if $x and $y are "too big".

Comment on Re^2: Hex String XOR
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2015-10-07 16:20 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (191 votes), past polls