-1

I have a unsigned long integer(8 bytes) which is guaranteed to be of 17 digits and i want it to store in int(4 bytes) which is of 9 digits at max. Basically i want to encrypt or compress the number so that i could retrieve the number without any loss of information.

boxer_1
  • 13
  • 4
  • 1
    Welcome to Stack Overflow! Please [take the tour](http://stackoverflow.com/tour), have a look around, and read through the help center, in particular [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask). What part are you stuck on? What have you tried? – Maciej Lach Oct 27 '15 at 08:19
  • Encryption and compression are two entirely different things. If you have arbitrary numbers then you cannot compress them. If there is some structure or pattern to the possible values, then it may be possible, but your question is entirely too broad as it currently stands. You [edit] it to include clarifications. – Artjom B. Oct 27 '15 at 10:22

1 Answers1

0

That is provably impossible. See the Pigeonhole Principle.

Mark Adler
  • 79,438
  • 12
  • 96
  • 137