Unishox.j; is a Julia package that provides access to the compression and decompression functions in the Unishox C library. It's algorithms are optimized for short Unicode strings. Compression is performed using an hybrid encoder that uses entropy, dictionary and delta encoding. For more details check the article
Two functions are exported by this package: compress
and decompress
.
Both accept a single AbstractString
argument and return a String
.
Here's an example using the functions at the REPL.
julia> using Unishox
julia> s = "๐I can do emojis"
"๐I can do emojis"
julia> sizeof(s)
19
julia> compressed = compress(s)
"\x9f\xc0R\xe3\x05\xaeg\x17T\x9f\x9a\xfd\xbd\x17"
julia> sizeof(compressed)
14
julia> decompress(compressed)
"๐I can do emojis"
This package is based on the Shoco.jl package.