Hacker News new | ask | show | jobs
by throwaway0094 4617 days 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.

1 comments

I 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. :)

It's using 0x8000, which is half of 0x10000 (the size of the basic multilingual plane). It doesn't extend out of BMP