3 ms·
rot13 is (X + (26/2)) mod 26 ; this is (X + (2^16)/2) mod 2^16. (The BMP is the first 2^16 code points of unicode.) Edit: silly formatting dropped my math punc
by throwaway0094 13y ago
rot13 is (X + (26/2)) mod 26 ; this is (X + (2^16)/2) mod 2^16. (The BMP is the first 2^16 code points of unicode.)
Edit: silly formatting dropped my math punctuation.
- CUViper 13y agoI suspect they also really wanted the rot8 -> "rotate" joke. AFAICS, it's actually using decimal 8000, not 2^16/2 = 0x8000, so I don't really understand how this is reversible at all unless they're just subtracting it back. What we really need is rot88000h for the full U+0..U+10FFFF range. :)
- rottytooth 13y agoIt's using 0x8000, which is half of 0x10000 (the size of the basic multilingual plane). It doesn't extend out of BMP