Program for compression

B

b

I have the idea, but I do not know how to program something like this:

Create sorted list with numbers
1
11
111
1111
....

2
22
222
2222
....

to
F
FF
FFF

1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
11
22
33
44
....
EEEEEEEEEEEEEEEE <---16 x E
FFFFFFFFFFFFFFFF <---16 x F



sorted list would look like this:
1
2
3
....


Read first n hex digits of some test file (%H) (n is the biggest
number , 16 if possible)
compare it with the list.

If %H matches number on list, great. Else:
Find first bigger number (%B) than %H.
%S = one number up on list, smaller than %H, unless maching number has
index(0),
and it is first on list.

Find %B - %H = %BR
Find %H - %S = %SR


If %H matches number on list, use that number. Else:
If %BR > %SR , use bigger number, %B. Otherwise use %S.
If they are the same use, %BR?

Write in new file %B or %S as number of digits: If %B or %S is FFFFFF,
then write it as
5F (5 times F). Write length of %BR or %SR, with two hex
numbers. Then write %BR or %SR. Next n digits.

In the begining there should be something like algorithm version.
there should be some some crc checking.

Is there someone who does?
 
K

Kevin Goodsell

b said:
I have the idea, but I do not know how to program something like this:

I don't see a C, C++, or Delphi issue in your post. Did you post to the
wrong group by mistake (three times)?

Please find a group where your message is topical. You might also want
to re-write it a little more clearly. I could not make heads or tails of it.

-Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top