Encoding and decoding of base36 strings