Giter VIP home page Giter VIP logo

chibi-txt's Introduction

chibiTxt

A simple file compressor using Rust.

📹 Tutorial:

❔ What is it?

Compresses files by using Huffman encoding.

📁 What file types?

Right now only txt. However, the code is simple enough to use with pretty much any file type, just requires a little bit of fine-tuning. The idea is to show how to write a simple encoding/decoding program.

How to use:

cargo run [input_file.txt] [output_key.txt] [output_file.bin] cargo run [input_file.bin] [input_key.txt] [decoded_file.txt]

Example:

Encode: user@computer:~/ cargo run -- -e "example_txt/war_and_peace.txt" "key.txt" "war_and_peace.bin"

File compression percentage: 145.35601197750995 Old file size: 3226652 (in bytes) After file size: 2219827 (in bytes)

Decode: user@computer:~/ cargo run -- -d "war_and_peace.bin" "key.txt" "decoded.txt"

Notes:

This can surely be optimized. It was one of my first projects in Rust, so I am sure I will look back in agony at how poorly it was done. However, that is a problem for future me.

❤️ How to Support ❤️

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.