Skip to content

rokath/tip

Repository files navigation

GitHub issues GitHub downloads GitHub code size in bytes GitHub watchers PRs Welcome Go Report Card


TiP - Tiny Packer For Very Small Buffers

+ Pack buffers from 2 bytes size for easy package framing❗
++ zeroes elimination and adaptable compression in one step

Table of Contents

(click to expand)

1. About The Project

  • Usual compressors cannot succeed on very small buffers (2...100 bytes), because they add translation information to the data:

    echo "try this" | gzip -c | wc -c
        29
    echo "Compress this normal line with 42 letters." | gzip -c | wc -c
        63
    echo "Compress this text and see how long it is afterwards. Today is a beautiful day. This example consists of 117 letters." | gzip -c | wc -c
       117
  • TiP is an adaptable very-short-buffer packer, suitable for embedded devices. Like COBS it removes all zeroes from the data, but additionally tries data compression.

  • The TiP worst-case overhead is 1 byte per each starting 7 bytes (+14%) or 1 byte for 3 uncompressable data bytes (+33%), but the expected average packed size is about 50% or less of the unpacked data. (For comparism: COBS adds 1 byte overhead per each starting 255 bytes, but does not compress at all.)

  • Like TCOBS, TiP can already compress 2 bytes into 1 byte but is expected to do better on arbitrary data (similar to samples) with a bit more computing effort.

(back to top)

2. Project Status

--> Experimental state! 
+   You can try it out!

quick start

(back to top)

3. TiP Components

  • C-Code usable on embedded devices inside src folder containing:
  • PC apps:
    • ti_generate - tiny generator to create a suitable idTable.c file
    • ti_pack - tiny pack using the pack C code mainly for tests
    • ti_unpack - tiny unpack using the unpack C code mainly for tests

(back to top)

4. Usage

See the Tip User Manual.

(back to top)

5. Roadmap

  • Create tipTable.h Generator ti_generate.
  • Create pack.c and unpack.c and test.
  • Write Tip User Manual.
  • Selectable unreplacable converter bit count (6 or 7).
  • Optimization for unreplacables.
  • Improve ti_generate to optimize pattern selection.
  • Extend ti_generate to find best settings automatically.
  • Build tip executable, which accepts stdin and writes to stdout.
  • Write extensive tests.
  • Write fuzzy tests.
  • Remove 65528 bytes limitation.
  • Compare automatic with:
  • Improve TiP pack code for speed and less RAM usage.
  • Write TiP unpack code in Go.

See the open issues for a full list of proposed features (and known issues).

(back to top)

6. Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

7. License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

8. Contact

contrib.rocks image

Thomas Höhenleitner - th@seerose.net

Project Link: https://github.com/rokath/tip

(back to top)

9. Acknowledgments

(back to top)

About

packer for tiny buffers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published