Encoding and Decoding a long string of numbers