#chess #pgn #huffman #command-line-tool #wasm #command-line-interface

app cgn-cli

A command-line tool for optimally compressing chess games in PGN format

2 releases

0.1.1 Feb 19, 2024
0.1.0 Feb 13, 2024

#109 in Compression

26 downloads per month

MIT and GPL-3.0+

36KB
687 lines

CGN-CLI (Compressed Game Notation Command Line Interface)

CGN-CLI is a simple command line interface for the CGN (Compressed Game Notation) library I created. It allows you to compress and decompress PGN files using the CGN library. It is designed to be fast, efficient, and flexible. It supports WASM compilation via wasm-pack, and contains 4 different compression algorithms to choose from.

Algorithms (High to Low Compression Ratios --- Low to High Speed)

  1. opening-huffman - A Huffman encoding algorithm that uses the huffman-encoding crate to compress the PGN data, but with an additional optimization for compressing common opening moves.
  2. dynamic-huffman - A Huffman encoding algorithm that uses the huffman-encoding crate to compress the PGN data, but with a huffman tree that is updated dynamically as the data is compressed.
  3. huffman - A Huffman encoding algorithm that uses a huffman-encoding crate to compress the PGN data.
  4. bincode - A simple binary encoding algorithm that uses the bincode crate to serialize the PGN data into a binary format.

Installation

cargo install cgn-cli

Getting Started

cgn-cli --help

Dependencies

~8.5MB
~141K SLoC