|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re^3: Hex String XORby tobyink (Monsignor) |
| on Mar 12, 2012 at 11:30 UTC ( #959110=note: print w/ replies, xml ) | Need Help?? |
|
Here's a solution that works on hex strings, so allows you to work with hex numbers larger than the maximum integers Perl can handle...
The chunk size of 4 is fairly conservative. It means that the string in processed in four-digit (i.e. 16 bit) chunks. You can probably get a minor speed up using a larger chunk size if you know that your computer will be able to handle it. The returned value will be left-padded with zeroes to be a length that is a multiple of the chunk size.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||