I finally got ( Recursive Lossless Random Data Compression ) accomplished...
( !!~~YAHOO~~!! ) I did it!!!!
This formula compresses any size file down to 29K.. And it's fast as hell...
Function compress_loop( chrs as string ) as string
dim as string map = string( len( chrs ) , "0" )
dim as string n1
dim as ubyte in , v1 , v2 , v3 , v4
for a as longint = 0 to len( chrs ) - 1 step 1
in = chrs[a]
v4 = in mod 4 : in = in shr 2
v3 = in mod 4 : in = in shr 2
v2 = in mod 4 : in = in shr 2
v1 = in
if v2 > 1 then v2-= 2 : map[a] = 49
select case v1
case 0 : v3+= 2
case 1 : v3+= 2 : v4+= 2
case 2 : v3+= 6
case 3 : v3+= 6 : v4+= 6
end select
if v3 = v4 then
v1 = ( v2 * 10 ) + v3
else
v1 = ( v2 * 100 ) + ( v3 * 10 ) + v4
end if
chrs[a] = v1
next
chrs+= "END"
for a as longint = 1 to len( map ) step 8
chrs+= chr( val( "&B" + mid( map , a , 8 ) ) )
next
return chrs
end function
Attached is:
1) Free BASIC source code
2) Windows executable
3) Zlib.dll ( zipper library )
Could you guys un-ban me from the forum..
I need to work with dodicat to do the decoder...