Appearently Crypto.Substitution()->set_rot_key(13)->encrypt(x) was too difficult to find so eMBee added String.rot13(), though 17 times slower. I obviously has an opinion as Crypto co-author, but I think it is reasonable to have ROT13 in the Crypto module instead of String.
Can't String.rot13() be an alias for Crypto.Substitution()->set_rot_key(13)->encrypt(x) ?
Crypto.Substitution()->set_rot_key(13)->encrypt(x) isn't something I want to write in my code.
We should be very careful with references between modules, especially something as central as the String module, or we'll get heaps of problems. If we want to have rot13 in String, making a replace() based implementation there would be a better solution.
I don't think it was an either or question though. Crypto.rot13(x) would of course also be a possiblity.
I don't think it was an either or question though. Crypto.rot13(x) would of course also be a possiblity.
+1, if it's an alias for your implementation, only with a fix key==13. (That way, it works a bit like the hash functions, and leaves kind of an implementation paper trail, presuming someone wanted to use another key. By which I mean rot13 is good, and a magic rot%d is not good. :-)
pike-devel@lists.lysator.liu.se