| Crates.io | seqcompress |
| lib.rs | seqcompress |
| version | 0.1.0 |
| created_at | 2023-01-18 13:03:01.154946+00 |
| updated_at | 2023-01-18 13:03:01.154946+00 |
| description | A toy compression algorithm that combines sequences of bytes into smaller strings |
| homepage | |
| repository | https://github.com/jewlexx/sqc |
| max_upload_size | |
| id | 761680 |
| size | 9,552 |
This is a proof-of-concept, "toy", compression algorithm that takes sequences of matching bytes and represents them as text.
This allows for unparalleled compression for a string such as aaaaaaaaaaaaaaaaaaaaaaaaaaa, but falls apart with anything more complex.
For example the string above would be represented as 97x27, 97 being the UTF-8, binary representation of the character "a". This representation takes up a mere 5 bytes whereas the uncompressed string takes up 27 bytes.
I compressed a 1GB file was 0 (not the character a binary 0) repeated 8 billion times. This was compressed to the string 0x8000000000, which is equivalent to about a 9999999985% decrease in size.
By comparison if you try to compress the Cargo.toml file in this repository, it goes from 180 bytes to 977 bytes which is a 442.778% increase in size.
Every compression algorithm needs a specification :)
x, followed by the number of times it was repeated.Made with 💗 by Juliette Cordor