I understand that data on computers can be compressed (I see it all the time with zip files and jpegs) but I was wondering just how compression works. Thinking it through, if you data is represented by 1s and 0s then it can be corresponded 1 to 1 with a binary number (albeit a large one). The idea behind compression is that some smaller number can represent the same data, but how is this possible since that new number must represent something else? I suppose if you know in advance that this number is a compressed version of another number than you can interpret it differently? Are there any relatively simple compression algorithms?
Labdabeta
182
Posting Pro in Training
Featured Poster
Recommended Answers
Jump to PostFor an introduction, look at Huffman Encoding. There is certainly much more than just that - but it should give you a start to get an understanding.
Jump to PostIf the algorithm was "simple" it probably wouldn't compress very well. If it helps you understand better, many compression algorithms actually can end up making a chunk of data larger if it's not suited for the task (notice how sound files don't compress very well at all with ZIP compression).
Jump to Post>>I am storing many variables of different types.
Can you convert/encode all those variables to a string version?
All 9 Replies
L7Sqr
227
Practically a Master Poster
Labdabeta
182
Posting Pro in Training
Featured Poster
Tumlee
42
Junior Poster in Training
mrnutty
761
Senior Poster
Labdabeta
182
Posting Pro in Training
Featured Poster
mrnutty
761
Senior Poster
MandrewP
60
Junior Poster in Training
MandrewP
60
Junior Poster in Training
Labdabeta
182
Posting Pro in Training
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.