That's interesting. So far as I know, the only documentation of the RAR compression algorithm is the official UnRAR tool¹, which (among other things) restricts you from using it to create a RAR-writer. There's also the GPL'd "unrar" based on UnRAR 2 (which doesn't handle modern RAR 3.x archives), and the GPL'd "unar"². Given that this is under the MIT licence, it can't be derived from any of those other tool, so I guess it must be a from-scratch reimplementation.<p>Well done!<p>¹: <a href="http://www.rarlab.com/rar/unrarsrc-5.0.12.tar.gz" rel="nofollow">http://www.rarlab.com/rar/unrarsrc-5.0.12.tar.gz</a>
²: <a href="http://unarchiver.c3.cx/commandline" rel="nofollow">http://unarchiver.c3.cx/commandline</a>
It would be good to note that this implementation doesn't actually support de-compression (as is also noted in the to-do list).<p>It is able to read headers and other metadata, as well as unpack files, but only if they're stored without compression: <a href="https://github.com/43081j/rar.js/blob/master/dist/rar.js#L545" rel="nofollow">https://github.com/43081j/rar.js/blob/master/dist/rar.js#L54...</a><p>If I understand RAR, it actually uses a embedded virtual machine to specify the compression algorithm. That would have been the fun part.
Very nice. Client side JS is getting more and more powerful. I've been playing with a JS gif compiler lately and I'm amazed it's even possible.