Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Transform a few numbers into one with key

  1. Dec 29, 2011 #1
    Dear all,

    Basically I am thinking of a possibility that I could transform several numbers into one using a key, which is reversible by using the same key afterwards, transform the one number back into its original separated form.

    I am not really good in number theory or cryptography but I tried searching on Google, I see that there might be some solutions in these fields but I am not sure whether this is feasible. I do understand that doing that will cause some errors so I would like to study it.

    In fact, I am thinking that representing the numbers using ASCII and perform some mathematical transformation might produce far better results than pure number manipulation.

    Does anyone have any idea or experience of doing this? If yes, is there any reference source that you may provide?

    Thank you so much!

    p/s: I am doing this because I just want to compress a large array of data into a small size to save power on wireless radio transmission.
  2. jcsd
  3. Dec 29, 2011 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    This* is provably impossible to do. For any scheme you try to invent, you'll find that you increase the size on average.

    *: Compressing binary data into a smaller amount of binary data without losing information

    Now, if your data has special properties (e.g. it's a text document), there are things you can do. But people have already written programs to do this; using one of those is likely to be easier and far better than anything you try to do, unless you have some specialized knowledge about the data you're trying to compress.

    If you're using a *NIX system, you should already have gzip and gunzip. I don't know any convenient choices for windows, though.

    Several programming languages have libraries to let you do compression.

    If you're just thinking about this for the fun of thinking about it, a good keyword would be "data compression".
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook