https://github.com/etdon/detect-compression
Simple script to detect popular compression algorithms based on their magic number.
https://github.com/etdon/detect-compression
compression compression-algorithm decompression decompression-algorithm
Last synced: about 2 months ago
JSON representation
Simple script to detect popular compression algorithms based on their magic number.
- Host: GitHub
- URL: https://github.com/etdon/detect-compression
- Owner: etdon
- License: apache-2.0
- Created: 2025-01-02T21:01:12.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-01-02T22:42:18.000Z (4 months ago)
- Last Synced: 2025-01-02T23:26:36.185Z (4 months ago)
- Topics: compression, compression-algorithm, decompression, decompression-algorithm
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
## 🔰 Introduction
The `detect-compression` project is a simple and easy to use script for detecting the compression algorithm used for the provided input.
It is powered by magic value analysis that allows the script to detect over 20 (including sub-types) popular compression algorithms.
While relying purely on magic value analysis of the header for compression algorithm detection is generally speaking not fully dependable
the system is processing in a most-to-least confident order and will provide meaningful results in common scenarios.## 🚀 Getting Started
> [!IMPORTANT]
> Requirements:
> - Python 3To download the script click on the green `Code` button and select `Download ZIP`. After unpacking the downloaded `.zip` archive you
will be able to run the script by executing the following command:
```
python detect_compression.py
```
The `input` parameter can either be a path to a file or a hex value. If a file path is provided the script will read the first 8 bytes of it and treat it as the input magic value for analysis.## 🫴 Contributing
The contribution guidelines are a part of the `shared-guidelines` repository and can be found here: [Contributing][contributing]## 📄 License
The `detect-compression` project is licensed under the [Apache 2.0 License][license].
```
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```[contributing]: https://github.com/etdon/shared-guidelines/blob/main/CONTRIBUTING.md
[license]: https://github.com/etdon/detect-compression/blob/master/LICENSE