Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Hex String XOR

by Marshall (Abbot)
on Mar 12, 2012 at 08:48 UTC ( #959081=note: print w/replies, xml ) Need Help??

in reply to Hex String XOR

I know question #2, chr() and ord()
#!/usr/bin/perl -w use strict; printf "%X\n", ord('a'); #61 printf "%X\n", ord('b'); #62 print chr(0x61); #a
still working on the best formulation for question #1. An issue is how to make it efficient.

Update: I think Moritz is on it.

pack() and unpack() are cool critters, but sometimes you have to stare at it for awhile. Example from the doc's:
sub ordinal { unpack("W",$_[0]); } # same as ord()

ord() and chr() are pretty "lightweight" critters. Without testing, I don't know if some kind of substr() based approach would be slower or faster. I assume for crypto, speed would be a major factor. On this performance point, I just don't know at the moment.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://959081]
[LanX]: Snowden remins me of Evan Spiegel (... start of a new conspiracy theory)
[LanX]: yes! The same person!
[Eily]: LanX can't be, they're both on the picture at the same time. Duh
[LanX]: They hired a Hollywood producer to fake the pic
LanX has to go and change location, I can hear THEM on the stairs...
[Eily]: they can't actually fake the pics, that's what they want you to believe so that you can't accept obvious proofs

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2018-03-19 15:30 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.