{"id":20784350,"url":"https://github.com/aks-/base-256","last_synced_at":"2025-06-28T18:11:09.080Z","repository":{"id":74717711,"uuid":"130339144","full_name":"aks-/base-256","owner":"aks-","description":"encode and decode base256 encoding  as gnu-tar does","archived":false,"fork":false,"pushed_at":"2018-05-02T11:21:37.000Z","size":28,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T20:45:31.274Z","etag":null,"topics":["gnu-tar","tar"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/aks-.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":"2018-04-20T09:15:54.000Z","updated_at":"2024-03-11T17:14:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"455428cd-dcba-4ac7-870c-c65767318426","html_url":"https://github.com/aks-/base-256","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/aks-/base-256","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aks-%2Fbase-256","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aks-%2Fbase-256/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aks-%2Fbase-256/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aks-%2Fbase-256/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aks-","download_url":"https://codeload.github.com/aks-/base-256/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aks-%2Fbase-256/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262474091,"owners_count":23316913,"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":["gnu-tar","tar"],"created_at":"2024-11-17T14:28:10.746Z","updated_at":"2025-06-28T18:11:09.060Z","avatar_url":"https://github.com/aks-.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base-256\n\nencode and decode base256 encoding  as gnu-tar does (supported range is -9007199254740991 to 9007199254740991).\n\n```\nnpm install base-256\n```\n\n[![Build Status](https://travis-ci.org/aks-/base-256.svg?branch=master)](https://travis-ci.org/aks-/base-256)\n\n## How it is different than buffer.writeInt32BE\nIt's a variable length encoding.\n\n## Usage\n\n``` js\nconst { encode, decode } = require('base-256')\n\nconst buf = new Buffer(12)\nencode(buf, 2147483647)\n// buf here is \u003cBuffer 80 7f ff ff ff\n\nconst decodedValue = decode(buf)\n// decodedValue is 2147483647\n```\n\n## API\n`base256.encode(buffer, num)`\nPass a buffer and the number that needs to be encoded. The number will be encoded into that buffer.\n\n`base256.decode(buf, [offset])`\nDecode a number from a buffer. If an offset is passed as the second argument the buf should be decoded at that byte offset. The byte offset defaults to 0.\n\n## Errors\n- Throws `TypeError` if the input yields a number that is out of range (-9007199254740991 to 9007199254740991).\n- Throws `TypeError` if the input is of not correct type.\n- Throws `TypeError` if the output of decoded value of encoded buffer goes out of range -9007199254740991 to 9007199254740735. \n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faks-%2Fbase-256","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faks-%2Fbase-256","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faks-%2Fbase-256/lists"}