@ASCII-only I'm not convinced that adding a `` and causing a warning makes it look better :P
@ბიმო I originally either subtracted 39 or added 161 to the remainder. Now, instead, I always subtract 39 and add 1 to the quotient in the cases when I would have added 161 before.
@JosephSible Sadly the xor method used in some other answers is not viable here since importing Data.Bits is too expensive. no idea if there's another easy-to-implement operation like xor that would give a permutation