Have an account?
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
Who's Online (1)
Looking to introduce yourself? Look no further, and click here! We also have IRC! [irc.evilzone.org #iexploit]
[Scala] text compression CLI tool
this is the first tool I created with Scala, it
is also the first time I am dealing with text compression. But it was a
lot of fun.
This tool uses the LZW algorithm to compress text files for you.
scala lzw.jar -c <filename> [<wordsize>]
scala lzw.jar -d <filename> [<wordsize>]
scala lzw.jar -v
scala lzw.jar -c input.txt 16
Compression done. Created output file input1.lzw
size of the input file: 1257260
size of the compressed file: 539175
compression ratio: 57%
A wordsize of 12 is usually good for small files, a wordsize of 16 or
more for large files. The default wordsize used will be 14 bits.
The wordsize for decompression
be the same as you used for compression. Otherwise it won't work.
I made some tests that show the compression ratio for different wordsizes:
Source and jar:
I would like to show the source right here, but it makes the post too long.
Nice share Deque!
Add a Comment