• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Compress string to a fixed length

I need to compress a string to a fixed length, e.g. 32 to 16. Then I need to decompress it back to 32. How do I do that?
0
suhani
Asked:
suhani
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
compressing a string cannot be done like this, unless you can have some assumptions. THe normal compression algorythms can have a 1:2 compression when having some data with many repetitions, but 32 caracters cannot be enough for "random" data.
CHeers
0
 
suhaniAuthor Commented:
Yes, the string is random. So if that's the case, can anyone suggest an algorithm that is best for this matter. I have tried zlib.dll but is there a better one?
0
 
DanRollinsCommented:
Hi suhani,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept angelIII's comment(s) as an answer.

suhani, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now