{"id":17859341,"url":"https://github.com/dex4er/js-nrv2e-decompress","last_synced_at":"2025-03-20T19:30:51.281Z","repository":{"id":32928259,"uuid":"142659426","full_name":"dex4er/js-nrv2e-decompress","owner":"dex4er","description":"Decompress with NRV2E algorithm","archived":false,"fork":false,"pushed_at":"2025-03-17T02:44:34.000Z","size":54,"stargazers_count":17,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T03:31:40.666Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dex4er.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-07-28T08:09:18.000Z","updated_at":"2025-01-17T02:42:54.000Z","dependencies_parsed_at":"2024-01-27T21:36:01.132Z","dependency_job_id":"63c7f1ba-782e-4a32-85fe-53b79fc8b941","html_url":"https://github.com/dex4er/js-nrv2e-decompress","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dex4er%2Fjs-nrv2e-decompress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dex4er%2Fjs-nrv2e-decompress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dex4er%2Fjs-nrv2e-decompress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dex4er%2Fjs-nrv2e-decompress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dex4er","download_url":"https://codeload.github.com/dex4er/js-nrv2e-decompress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971129,"owners_count":20376785,"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":["hacktoberfest"],"created_at":"2024-10-28T06:42:27.121Z","updated_at":"2025-03-20T19:30:50.846Z","avatar_url":"https://github.com/dex4er.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nrv2e-decompress\n\n\u003c!-- markdownlint-disable MD013 --\u003e\n\n[![GitHub](https://img.shields.io/github/v/release/dex4er/js-nrv2e-decompress?display_name=tag\u0026sort=semver)](https://github.com/dex4er/js-nrv2e-decompress)\n[![CI](https://github.com/dex4er/js-nrv2e-decompress/actions/workflows/ci.yaml/badge.svg)](https://github.com/dex4er/js-nrv2e-decompress/actions/workflows/ci.yaml)\n[![Trunk Check](https://github.com/dex4er/js-nrv2e-decompress/actions/workflows/trunk.yaml/badge.svg)](https://github.com/dex4er/js-nrv2e-decompress/actions/workflows/trunk.yaml)\n[![Coverage Status](https://coveralls.io/repos/github/dex4er/js-nrv2e-decompress/badge.svg)](https://coveralls.io/github/dex4er/js-nrv2e-decompress)\n[![npm](https://img.shields.io/npm/v/nrv2e-decompress.svg)](https://www.npmjs.com/package/nrv2e-decompress)\n\n\u003c!-- markdownlint-enable MD013 --\u003e\n\nDecompress with NRV2E algorithm.\n\n## Requirements\n\nThis is ESM module which requires ES2020 and Node \u003e= 14.\n\n## Installation\n\n```shell\nnpm install nrv2e-decompress\n```\n\n_Additionally for Typescript:_\n\n```shell\nnpm install -D @types/node\n```\n\n## Usage\n\n```js\nimport nrv2eDecompress from \"nrv2e-decompress\"\n```\n\n### nrv2eDecompress\n\n```js\nnrv2eDecompress(input, output, bufferBits)\n```\n\n_Arguments:_\n\n- `input` is a `Buffer` with compressed data\n- `output` is a `Buffer` from decompressed data and it have to be pre-allocated,\n  ie. with `Buffer.alloc` method\n- `bufferBits` is a number of control buffer bits: `8`, `16` or `32` (optional:\n  default: `8`)\n\n_Example:_\n\n```js\n// Polish vehicle registration certificate scanned from Aztec 2D barcode\nconst b64Input = \"BgQAANtYAA...\"\nconst binInput = Buffer.from(b64Input, \"base64\")\n\n// 4 first bytes in Aztec code are output length\nconst outputLength = binInput.readUInt32LE(0)\nconst utf16Output = Buffer.alloc(outputLength)\nconst compressedInput = binInput.slice(4)\n\nnrv2eDecompress(compressedInput, utf16Output)\n\nconst textOutput = utf16Output.toString(\"utf16le\")\n```\n\n## License\n\nCopyright (c) 2018-2024 Piotr Roszatycki \u003cpiotr.roszatycki@gmail.com\u003e\n\nThis code is based on UCL data compression library:\n\nCopyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n[GPL-2.0](https://opensource.org/licenses/GPL-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdex4er%2Fjs-nrv2e-decompress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdex4er%2Fjs-nrv2e-decompress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdex4er%2Fjs-nrv2e-decompress/lists"}