Hey,
I need to compress relatively short strings(or integer/long) in vb.net, i've been told base64 is the direction to head in, but simply using convert.tobase64string() on a string of my length just makes it longer
the strings i will be using will always be of the same length and type, just different numbers, for example: "1406891123456777"
any level of compression is appreciated
Thanks,
Howard
Loading
Sam HobbsPosted Apr 21, 2010, 6:12 PM
Hans KreigerPosted Apr 21, 2010, 9:42 AM
Would you mind expanding on that for a larger string and maybe point me towards some vb.net functions that i should use to achieve it?
Sam HobbsPosted Apr 19, 2010, 3:05 PM
Perhaps what your instructor is saying is that you could make the data binary, so that the value 257 would be 0101 hexadecimal (two bytes). If the data is text data, then 257 I think would be 323537 hexadecimal (3 bytes). If you can send the binary data, then it will be shorter than if you send the text. If however you must send text data, then if you convert the binary data using base64, then the data I think would be shorter than if the numbers are sent as text.
So the question "Can the output be binary or does the output need to be text?" is highly relevant and I don't understand "anything really so long as i can convert it to byte array without losing the compress effect", especially since there would be no compression if the data is sent as binary. The compression is not relevant if you send the data as binary, so answerig the question of whether the data can be sent as binary by saying that the data must be sent without losing compression is just making an infinte loop.
Hans KreigerPosted Apr 19, 2010, 6:20 AM
Hans KreigerPosted Apr 5, 2010, 12:04 PM
my tutor said he successfully achieved this using base 64
Thanks,
Howard
Sam HobbsPosted Apr 5, 2010, 11:54 AM
Can the output be binary or does the output need to be text?
Will the numbers occur multiple times within the data to be compressed or just once?
Is it necessary to also compress the delimiting characters or can delimiting characters be not saved? When I say delimiting characters, I mean characters between the numbers.