{"id":21981710,"url":"https://github.com/cronokirby/huffman-rs","last_synced_at":"2025-03-23T01:18:26.443Z","repository":{"id":81581491,"uuid":"174216508","full_name":"cronokirby/huffman-rs","owner":"cronokirby","description":"An implementation of Huffman coding","archived":false,"fork":false,"pushed_at":"2019-03-11T01:36:11.000Z","size":57,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-28T04:29:09.704Z","etag":null,"topics":["compression","huffman-coding","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cronokirby.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-06T20:32:12.000Z","updated_at":"2019-03-13T21:26:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf944d71-f2fa-4765-9475-4c3e32dd5c6b","html_url":"https://github.com/cronokirby/huffman-rs","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/cronokirby%2Fhuffman-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cronokirby%2Fhuffman-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cronokirby%2Fhuffman-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cronokirby%2Fhuffman-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cronokirby","download_url":"https://codeload.github.com/cronokirby/huffman-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245041001,"owners_count":20551342,"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":["compression","huffman-coding","rust"],"created_at":"2024-11-29T17:19:15.836Z","updated_at":"2025-03-23T01:18:26.436Z","avatar_url":"https://github.com/cronokirby.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Huffman\nThis is a little command line program using [Huffman Coding](https://en.wikipedia.org/wiki/Huffman_coding)\nto compress and decompress files\n\n## Usage\n```\nUSAGE:\n    huffman \u003cSUBCOMMAND\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nSUBCOMMANDS:\n    decode    Decode a file\n    encode    Encode a file\n    help      Prints this message or the help of the given subcommand(s)\n```\nHuffman features 2 modes, encoding and decoding. The typical use case is first using the `encode`\ncommand to compress a file, and then the `decode` file to decompress it later.\n\n## Encoding\n```\nUSAGE:\n    huffman encode \u003cinput\u003e -o \u003coutput\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -o \u003coutput\u003e        The output file to put the decoded text into\n\nARGS:\n    \u003cinput\u003e    The input file to encode\n```\nThis encodes a file by counting the occurrences of each byte in the file,\nand using that to construct a Huffman tree and assign a bit pattern to each byte.\nThe output is a binary file, prefixed with the byte counts, and then followed\nby a stream of encoded bytes. Because we include the byte counts at the start of the file,\nwe can rebuild the Huffman tree when decompressing the file.\n\n## Decoding\n```\nUSAGE:\n    huffman decode \u003cinput\u003e -o \u003coutput\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -o \u003coutput\u003e        The output file to put the decoded text into\n\nARGS:\n    \u003cinput\u003e    The input file to decode\n```\nThis is the reverse of the encoding operation. This must be used on a file\nencoded with the same version of the program, otherwise unkown results will happen.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcronokirby%2Fhuffman-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcronokirby%2Fhuffman-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcronokirby%2Fhuffman-rs/lists"}