Program for compression

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • b

    Program for compression

    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
    ....
    EEEEEEEEEEEEEEE E <---16 x E
    FFFFFFFFFFFFFFF F <---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?
  • Kevin Goodsell

    #2
    Re: Program for compression

    b wrote:
    [color=blue]
    > I have the idea, but I do not know how to program something like this:
    >[/color]

    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
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.

    Comment

    Working...