{"id":19347643,"url":"https://github.com/bulatruslanovich/arithmetic-coding","last_synced_at":"2025-02-24T09:44:55.234Z","repository":{"id":228564132,"uuid":"774336954","full_name":"BulatRuslanovich/Arithmetic-coding","owner":"BulatRuslanovich","description":"Arithmetic coding - common algorithm used in both lossless and lossy data compression algorithms","archived":false,"fork":false,"pushed_at":"2024-03-19T11:39:17.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-06T14:44:03.489Z","etag":null,"topics":["arithmetic-coding","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BulatRuslanovich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-19T11:24:43.000Z","updated_at":"2024-04-04T07:08:08.000Z","dependencies_parsed_at":"2024-03-19T12:44:49.725Z","dependency_job_id":"ce0901f7-a719-47a9-8e55-f4ca9f752855","html_url":"https://github.com/BulatRuslanovich/Arithmetic-coding","commit_stats":null,"previous_names":["bulatruslanovich/arithmetic-coding"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BulatRuslanovich%2FArithmetic-coding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BulatRuslanovich%2FArithmetic-coding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BulatRuslanovich%2FArithmetic-coding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BulatRuslanovich%2FArithmetic-coding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BulatRuslanovich","download_url":"https://codeload.github.com/BulatRuslanovich/Arithmetic-coding/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240457943,"owners_count":19804489,"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":["arithmetic-coding","php"],"created_at":"2024-11-10T04:17:27.033Z","updated_at":"2025-02-24T09:44:55.033Z","avatar_url":"https://github.com/BulatRuslanovich.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arithmetic-coding\n### Арифметическое кодирование / Arithmetic coding\n\n*Арифметическое кодирование — один из алгоритмов энтропийного сжатия.*\n\n*В отличие от алгоритма Хаффмана, не имеет жесткого постоянного соответствия входных символов группам бит выходного потока. Это даёт алгоритму большую гибкость в представлении дробных частот встречаемости символов.*\n\n*Как правило, превосходит алгоритм Хаффмана по эффективности сжатия, позволяет сжимать данные с энтропией, меньшей 1 бита на кодируемый символ, но некоторые версии имеют патентные ограничения от компании IBM.* (wikipedia)\n![image](https://github.com/BulatRuslanovich/Arithmetic-coding/assets/113189826/888b7029-fa18-4ae6-af8b-ac7fb8c76a2e)\n![image](https://github.com/BulatRuslanovich/Arithmetic-coding/assets/113189826/f099e624-be51-4ebb-a9b3-24edf44aa449)\n![image](https://github.com/BulatRuslanovich/Arithmetic-coding/assets/113189826/e1dc8e6d-04fb-417a-9723-1b564a73f1f7)\n\n\n### Общий принцип (алгоритм) работы:\n#### Кодирование:\n1. На вход программы поступает текст - вводится с клавиатуры.\n2. Из полученного текста создается алфавит - массив символов, исключающий повторы.\n3. Создается массив накапливаемых частот (размер которого равен размеру алфавита) для символов из алфавита.\n4. Вызывается классовый метод кодирования, преобразующий исходный текст в последовательность 0 и 1\n\n#### Раскодирование:\n1. На вход поступает строка, состоящая из закодированных символов (т.е. кодовая строка из 0 и 1).\n2. Вызывается классовый метод декодирования, преобразующий последовательность 0 и 1 в исходный текст\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulatruslanovich%2Farithmetic-coding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbulatruslanovich%2Farithmetic-coding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulatruslanovich%2Farithmetic-coding/lists"}