I've used @Mollymews's key packing functions in a few projects now and they're quite great.
For a lot of use cases though, it's only necessary to go one way: compress the key, store it in a list, then later compress a new key and see if it was already in the list.
With the limited arithmetic LL gives us, it is possible to losslessly compress a key into a rotation, but I don't think it is possible to undo this operation without an accurate log base 2 function.
rotation key2pack(key
Dumping these here; more key packing ideas for use in utf-8 (I.E. LinksetData)
base 95 was a bit harder than I thought it would be, because I forgot negative numbers are a thing. I've not thoroughly checked edge-cases, nor unwrapped function calls, nor pre-calculated powers of 95.
string KeyToB64(string s)
{ integer a = (integer)("0x"+s);
integer b = (integer)("0x"+llGetSubString(s,9,12)+llGetSubString(s,14,17));
integer c = (integer)("0x"+llGetSubString(s,19,22)+llGetSubString