go ahead... be a heretic | |
PerlMonks |
Re: Perl function equivalent to PHP xormaskby graff (Chancellor) |
on Mar 20, 2016 at 00:15 UTC ( [id://1158339]=note: print w/replies, xml ) | Need Help?? |
It's not clear to me that there is a commonly-known PHP function called "XORmask" (at least, nothing that can be found via Google). Could you point us to some documentation that describes this function? (Could it be something that is defined in the PHP code that you started from?)
Also, unless there's a description of this "XORmask" function that explains how it arrives at the output you say it yields, I'm at a loss how to come up with similar results. I tried this little test script, which decodes your base64 input string to the series of bytes you suggest - but just to be clear, I'm displaying each byte as a 2-digit hex number; I'm also breaking up the character sequence that you say you expect to get as a result, and I display this as a sequence of hex numbers as well. The two sequences are displayed next to each other below, values from decode_base64 on the left, and your expected output on the right: So, apart from not seeing any coherent pattern here, I'm wondering what sort of function this is supposed to be. It's clearly not any kind of bit-wise logic operation, because a given input value can 'yield' different outputs (lines "7:" and "15:" above), and different inputs can yield the same output (lines "3:", "14." and "15."). You need to give us a better description of the functionality you are looking for.
In Section
Seekers of Perl Wisdom
|
|