4 ms·
It may also be that you're rotating by 0x8000 and this code is not. It's creating a mapping that's restricted to non-control, non-surrogate, non-whitespace char
by brlewis 8y ago
It may also be that you're rotating by 0x8000 and this code is not. It's creating a mapping that's restricted to non-control, non-surrogate, non-whitespace characters and rotating by half the size of that mapping.
https://github.com/rottytooth/rot8000/blob/master/Rottytooth.Rot8000/Rotator.cs https://github.com/rottytooth/rot8000/blob/master/Rottytooth...
- danbruc 8y agoThis will break, i.e. two consecutive rotations will no longer be the identity, if the number of valid characters in the BMP ever becomes odd. And there are still a few unallocated code points in the BMP. There is also an overflow in line 39 because of the check i <= BMP_SIZE in line 37 which, I guess, previously used Char.MaxValue instead of BMP_SIZE. But it does no harm here, U+0000 just gets filtered out twice.
- platforms 8y agoThere's a test for BMP characters being even: https://github.com/rottytooth/rot8000/blob/master/Rottytooth.Rot8000.Tests/MappingsTests.cs https://github.com/rottytooth/rot8000/blob/master/Rottytooth... More critically, if the # of valid chars changes, previously rot-8000'd text will no longer be reversible through the tool