compress

Compresses input using 8-bit Nintendo DS Huffman encoding (magic 0x28).

The output is always decompressible by decompress. For highly repetitive input the compressed size will be smaller than the input; for already-random or very short data the overhead of the tree may make the output larger.

Return

Compressed byte array including the 4-byte header and Huffman tree.

Parameters

input

Raw byte array to compress.