Encodes a string using a custom alphabet by reslicing the bits of the byte array.

getBaseXResliceCodec for a more detailed description.