Encoding and decoding integer in 6-character hash