{"id":19815977,"url":"https://github.com/fytex/shafa-cd","last_synced_at":"2025-07-25T06:35:25.377Z","repository":{"id":41343184,"uuid":"315911573","full_name":"Fytex/Shafa-CD","owner":"Fytex","description":"File Compressor written in C using both Shannon Fano and RLE algorithms","archived":false,"fork":false,"pushed_at":"2021-01-12T15:15:41.000Z","size":398,"stargazers_count":24,"open_issues_count":0,"forks_count":8,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-11T02:02:50.503Z","etag":null,"topics":["binary-code","c","clang","compressor","decompressor","matrix","rle","rle-compression-algorithm","shafa","shannon-fano","shannon-fano-algorithm","shannonfano"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fytex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-25T10:58:57.000Z","updated_at":"2024-12-15T13:28:17.000Z","dependencies_parsed_at":"2022-09-19T02:42:41.331Z","dependency_job_id":null,"html_url":"https://github.com/Fytex/Shafa-CD","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fytex%2FShafa-CD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fytex%2FShafa-CD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fytex%2FShafa-CD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fytex%2FShafa-CD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fytex","download_url":"https://codeload.github.com/Fytex/Shafa-CD/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fytex%2FShafa-CD/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259184731,"owners_count":22818265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-code","c","clang","compressor","decompressor","matrix","rle","rle-compression-algorithm","shafa","shannon-fano","shannon-fano-algorithm","shannonfano"],"created_at":"2024-11-12T10:07:55.389Z","updated_at":"2025-06-11T02:03:29.082Z","avatar_url":"https://github.com/Fytex.png","language":"C","readme":"![GitHub top language](https://img.shields.io/github/languages/top/fytex/Shafa-CD?style=for-the-badge)\n\n\n# What is Shafa?\n\n**Shafa** is a free and open-source program made for Lossless files' compression written in C (2020/21).  \nIt is OS independent and some modules are multithread executed if running on Windows or POSIX-compliant (allowing pthreads).  \n\nUses two algorithms for compression:\n - **RLE**\n - **Shannon Fano** with blocks of length 1 (K=1).\n\nFor RLE's decompression a .freq file is needed along with the .rle file.  \nFor Shannon Fano's decompression a .cod file is needed along with .shaf.  \n(All these files are generated by the program)\n\n## Modules:\n  - F ( RLE compression and Frequencies calculation )\n  - T ( Codes calculation using Shannon-Fano's algorithm )\n  - C ( Shannon-Fano compression )\n  - D ( RLE and Shannon-Fano decompression )\n \n#### SETUP - \\*NIX\n```\ngcc -o shafa $(find ./src -name '*.c' -or -name '*.h') -O3 -Wno-format -pthread\n```\n\n#### SETUP - WINDOWS\n```\ngcc -o shafa src/*.c src/*.h src/*/*.c src/*/*.h src/*/*/*.c src/*/*/*.h -O3 -Wno-format\n```\n\n\n### How to execute?\nOpen terminal where the created executable `shafa` is located and type the following:\n\n**Windows**:\n - shafa.exe \\\u003cfile\u003e \\\u003coptions\u003e\n\n**\\*NIX**:\n - ./shafa \\\u003cfile\u003e \\\u003coptions\u003e\n\n### CLI Options:\n    -m \u003cmodule\u003e      :  Executes respective module (Can be executed more than one module if possible)\n    -b \u003cK/m/M\u003e       :  Blocks size for compression (default: K)\n    -c \u003cr/f\u003e         :  Forces execution (r -\u003e RLE's compress | f -\u003e Original file's frequencies)\n    -d \u003cs/r\u003e         :  Only executes a specific decompression (s -\u003e Shannon-Fano's algorithm | r -\u003e RLE's algorithm)\n    --no-multithread :  Disables multithread \n    \n    \n### Blocks Size:\n  - K = 640 KiB\n  - m =   8 MiB\n  - M =  64 MiB\n\n**Note:** Multithread was only implemented in modules C and D (the ones that cost the most)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffytex%2Fshafa-cd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffytex%2Fshafa-cd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffytex%2Fshafa-cd/lists"}