{"id":18441150,"url":"https://github.com/onesy-me/huffman-code","last_synced_at":"2025-04-07T22:32:06.388Z","repository":{"id":44306715,"uuid":"459019357","full_name":"onesy-me/huffman-code","owner":"onesy-me","description":"Huffman code","archived":false,"fork":false,"pushed_at":"2024-12-12T22:32:38.000Z","size":740,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T01:35:41.892Z","etag":null,"topics":["amaui","backend","binary-compression","browser","byte-compression","compression","frontend","huffman","huffman-algorithm","huffman-coding","huffman-compression-algorithm","huffman-compressor","huffman-encoder","huffman-tree","javascript","js","text-compression","typescript","utils","web"],"latest_commit_sha":null,"homepage":"https://docs.onesy.me/library/huffman-code","language":"TypeScript","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/onesy-me.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":"2022-02-14T04:48:33.000Z","updated_at":"2024-12-12T22:32:43.000Z","dependencies_parsed_at":"2024-12-11T20:36:45.586Z","dependency_job_id":"fbb86e44-2e37-410b-b65d-296e1d4dce4b","html_url":"https://github.com/onesy-me/huffman-code","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"23dedaf71efa674e72bbc8c9f0b76c7937712276"},"previous_names":["onesy-me/amaui-huffman-code","amaui-org/amaui-huffman-code"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fhuffman-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fhuffman-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fhuffman-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fhuffman-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onesy-me","download_url":"https://codeload.github.com/onesy-me/huffman-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247741176,"owners_count":20988347,"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":["amaui","backend","binary-compression","browser","byte-compression","compression","frontend","huffman","huffman-algorithm","huffman-coding","huffman-compression-algorithm","huffman-compressor","huffman-encoder","huffman-tree","javascript","js","text-compression","typescript","utils","web"],"created_at":"2024-11-06T06:35:11.661Z","updated_at":"2025-04-07T22:32:01.376Z","avatar_url":"https://github.com/onesy-me.png","language":"TypeScript","readme":"\n\u003c/br\u003e\n\u003c/br\u003e\n\n\u003cp align='center'\u003e\n  \u003ca target='_blank' rel='noopener noreferrer' href='#'\u003e\n    \u003cimg src='utils/images/logo.svg' alt='amaui logo' /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align='center'\u003eamaui Huffman Code\u003c/h1\u003e\n\n\u003cp align='center'\u003e\n  Own implementation of Huffman coding algorithm\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\u003ch3 align='center'\u003e\n  \u003csub\u003eMIT license\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eProduction ready\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eUMD 11.9kb gzipped\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003e100% test cov\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eBrowser and Nodejs\u003c/sub\u003e\n\u003c/h3\u003e\n\n\u003cp align='center'\u003e\n  \u003csub\u003eVery simple code\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eModern code\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eJunior friendly\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eTypescript\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eMade with :yellow_heart:\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n## Getting started\n\n### Add\n\n```sh\nyarn add @amaui/huffman-code\n```\n\n### Use\n\n```javascript\n  import AmauiHuffmanCode from '@amaui/huffman-code';\n\n  // Make a new AmauiHuffmanCode instance\n  // with an optional initial values\n  // string to encode, already calculated probabilities and\n  // already calculated values\n  // On making an instance encoding will be made\n  const amauiHuffmanCode = new AmauiHuffmanCode('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dolor sem, facilisis sed erat sit amet, pharetra blandit augue. Sed id placerat felis, malesuada rutrum nisl. In ultrices sed mauris finibus malesuada. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer cursus, odio id rutrum blandit, neque velit aliquam odio, at rhoncus elit est nec erat. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi metus.');\n\n  // Initial byte size value\n  // is 589 bytes, and after using\n  // above method, encoded byte size is 444 bytes\n  // including huffman code dictionary,\n  // which is 7.3 compression percentage\n\n  // Encoded\n  // or very simply amauiHuffmanCode.response\n  const response = amauiHuffmanCode.encoded;\n\n  // {\n  //   \"value\": \"AAL/AAgr6XUV8YbCGqY3XUfY4tSPAAoACDcaXTR5Z5laY83/KjrGGwAIalf7e3Hm01NakbIADo1TG66j7OfcAAoAA7frcxpjcTwl5vcjaTZ1uOg6N7K019r9ZUXG7AAFAABXzTVvM/NitAAEnVakbX4gmt7S0/irX6youN3merdVbnQmjRx5idQnka9FuNrTAAIdoEPRJozkGOLF+nsw1AAHfZyDSx06AAaz6bpuQ15n5oTxAAY5AAUVfYTSOk2AoAAK+/W5jTH2ZeiWe1aY3Wn0XXwmkft0YHwscqytMZVGZHyDo83vAAGWyeKo6tfiAAmsrTH2qY3XUa42VRKzTU6ldyDdHmeg6tLQgMV9fqrsyPrjZVErAAFAFfzfxTWON7iYc9pk3RNZ/KoAB+3HzhCO0K1irOVrJoVeiWpG838ACyPlGaanXUFXBA==\",\n  //   \"values\": {\n  //       \"r\": \"0000\",\n  //       \"o\": \"0001\",\n  //       \"u\": \"0010\",\n  //       \"d\": \"00110\",\n  //       \"c\": \"00111\",\n  //       \"e\": \"010\",\n  //       \"n\": \"0110\",\n  //       \"p\": \"01110\",\n  //       \"g\": \"0111100\",\n  //       \"C\": \"01111010\",\n  //       \"v\": \"01111011\",\n  //       \"h\": \"0111110\",\n  //       \"I\": \"01111110\",\n  //       \"j\": \"01111111\",\n  //       \"t\": \"1000\",\n  //       \"i\": \"1001\",\n  //       \"s\": \"1010\",\n  //       \"l\": \"10110\",\n  //       \"m\": \"10111\",\n  //       \" \": \"110\",\n  //       \"a\": \"1110\",\n  //       \".\": \"111100\",\n  //       \"q\": \"1111010\",\n  //       \"f\": \"11110110\",\n  //       \"S\": \"111101110\",\n  //       \"P\": \"111101111\",\n  //       \",\": \"111110\",\n  //       \"b\": \"1111110\",\n  //       \"D\": \"11111110\",\n  //       \"L\": \"111111110\",\n  //       \"F\": \"111111111\"\n  //   },\n  //   \"values_encoded\": \"0000 ro 1 u 1 dc 1 e 1 n 1 p 2 g 1 Cv 1 h 1 Ij 4 ti 1 s 1 lm 1   1 a 2 . 1 q 1 f 1 SP 1 , 1 b 1 D 1 LF\",\n  //   \"probabilities\": {\n  //       \"L\": 0.0017,\n  //       \"o\": 0.0475,\n  //       \"r\": 0.0526,\n  //       \"e\": 0.0985,\n  //       \"m\": 0.039,\n  //       \" \": 0.1511,\n  //       \"i\": 0.0764,\n  //       \"p\": 0.0187,\n  //       \"s\": 0.0815,\n  //       \"u\": 0.0526,\n  //       \"d\": 0.0306,\n  //       \"l\": 0.0407,\n  //       \"t\": 0.0781,\n  //       \"a\": 0.0696,\n  //       \",\": 0.017,\n  //       \"c\": 0.0306,\n  //       \"n\": 0.0441,\n  //       \"g\": 0.0068,\n  //       \".\": 0.017,\n  //       \"F\": 0.0017,\n  //       \"f\": 0.0051,\n  //       \"h\": 0.0051,\n  //       \"b\": 0.0068,\n  //       \"S\": 0.0017,\n  //       \"I\": 0.0034,\n  //       \"C\": 0.0034,\n  //       \"q\": 0.0085,\n  //       \"v\": 0.0034,\n  //       \"P\": 0.0017,\n  //       \"D\": 0.0034,\n  //       \"j\": 0.0017\n  //   },\n  //   \"efficiency\": 0.991,\n  //   \"redundency\": 0.037,\n  //   \"entropy\": 4.138,\n  //   \"original_byte_size\": 589,\n  //   \"values_byte_size\": 102,\n  //   \"value_byte_size\": 444,\n  //   \"encoded_byte_size\": 546,\n  //   \"compression_ratio\": 1.08,\n  //   \"compression_percentage\": 7.3,\n  //   \"positive\": true,\n  //   \"average_code_word_length\": 4.175,\n  //   \"performance_milliseconds\": 4,\n  //   \"performance\": \"4 milliseconds\"\n  // }\n\n  // Decode\n  // with amauiHuffmanCode.decode or AmauiHuffmanCode.decode a static method\n  AmauiHuffmanCode.decode(response.value, response.values);\n\n  // {\n  //   \"value\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dolor sem, facilisis sed erat sit amet, pharetra blandit augue. Sed id placerat felis, malesuada rutrum nisl. In ultrices sed mauris finibus malesuada. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer cursus, odio id rutrum blandit, neque velit aliquam odio, at rhoncus elit est nec erat. Proin egestas mauris elit, sit amet molestie nisi semper at. Cras interdum massa nec molestie rutrum. Duis commodo venenatis justo, ac porta tellus pellentesque sed. Donec et nisi metus.\",\n  //   \"original_byte_size\": 589,\n  //   \"value_byte_size\": 444,\n  //   \"performance_milliseconds\": 7,\n  //   \"performance\": \"7 milliseconds\"\n  // }\n```\n\n### Dev\n\nInstall\n\n```sh\nyarn\n```\n\nTest\n\n```sh\nyarn test\n```\n\n### Prod\n\nBuild\n\n```sh\nyarn build\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesy-me%2Fhuffman-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonesy-me%2Fhuffman-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesy-me%2Fhuffman-code/lists"}