DEV Community

loading...
Cover image for Introducing Online GZIP de/compressor, built with Blazor WebAssembly

Introducing Online GZIP de/compressor, built with Blazor WebAssembly

Niels Swimberghe
Belgian Full Stack Developer solving problems and delivering value to customers using .NET technologies for back-end systems, and modern JavaScript technologies for the front-end.
Originally published at swimburger.net on ・2 min read

Web Assembly (WASM) has allowed many different programming platforms to now be supported inside of the web browser. You can now develop C# .NET applications that run inside of the browser using Blazor WebAssembly.

A large amount of the .NET API is now usable right inside the browser when you use Blazor WASM. One of those API's is the GzipStream class which you can use to compress and decompress files using the GZIP algorithm. Unfortunately, the Brotli API's aren't supported in Blazor WASM.

Using Blazor WASM and the GZIP API's I created this little web application which you can use to compress and decompress multiple files using GZIP. All the files are de/compressed right inside of the browser without transmitting them to a server. This does mean that it is using your device to perform this task and the size of the files are limited depending on the limitation of your browser. Here's a preview:

Two files are dragged into the GZIP compression web application. The button "Compress Files" is clicked. The files are listed and have a loading animation next to their name. The files are compressed and downloaded back to the device.

The application also works offline and is installable thanks to the PWA capabilities built-in to Blazor WASM.

Both Windows, Mac, and Linux operating systems already have built-in ways to de/compress files using GZIP, but you can also use this tool if you prefer a web application over the command line utilities. You can find the source code on GitHub.

Discussion (0)