{"id":19343316,"url":"https://github.com/obusk/read-bigint","last_synced_at":"2025-04-23T04:35:36.331Z","repository":{"id":38359923,"uuid":"244061689","full_name":"oBusk/read-bigint","owner":"oBusk","description":"👓💯 Packages of Node Buffer methods readBigInt64BE, readBigInt64LE, readBigUInt64BE, and readBigUInt64LE","archived":false,"fork":false,"pushed_at":"2023-01-31T11:00:52.000Z","size":1043,"stargazers_count":4,"open_issues_count":6,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-29T19:40:41.142Z","etag":null,"topics":["bigint","buffer","javascript","node","nodejs","read","readbigint","signed","unsigned"],"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/oBusk.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}},"created_at":"2020-03-01T00:18:49.000Z","updated_at":"2022-02-23T21:45:20.000Z","dependencies_parsed_at":"2023-02-16T18:32:19.459Z","dependency_job_id":null,"html_url":"https://github.com/oBusk/read-bigint","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fread-bigint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fread-bigint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fread-bigint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fread-bigint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oBusk","download_url":"https://codeload.github.com/oBusk/read-bigint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223910075,"owners_count":17223591,"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":["bigint","buffer","javascript","node","nodejs","read","readbigint","signed","unsigned"],"created_at":"2024-11-10T03:38:00.698Z","updated_at":"2024-11-10T03:38:01.380Z","avatar_url":"https://github.com/oBusk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Read BigInt\n\n[![NPM Version](https://img.shields.io/npm/v/read-bigint)](https://www.npmjs.com/package/read-bigint)\n[![Node.js CI](https://github.com/oBusk/read-bigint/workflows/Node.js%20CI/badge.svg)](https://github.com/oBusk/read-bigint/actions?query=workflow%3A%22Node.js+CI%22)\n[![CodeQL](https://github.com/oBusk/read-bigint/workflows/CodeQL/badge.svg)](https://github.com/oBusk/read-bigint/actions?query=workflow%3ACodeQL)\n[![Dependabot: enabled](https://badgen.net/badge/dependabot/enabled/green?icon=dependabot)](https://github.com/oBusk/read-bigint/network/updates)\n[![codecov](https://codecov.io/gh/oBusk/read-bigint/branch/master/graph/badge.svg)](https://codecov.io/gh/oBusk/read-bigint)\n[![Bundlesize](https://img.shields.io/bundlephobia/minzip/read-bigint)](https://bundlephobia.com/result?p=read-bigint)\n[![Bundle Watched](https://img.shields.io/badge/bundle-watched-blue.svg)](https://bundlewatch.io)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n\u003e 👓💯 Read Unsigned/Signed Big/Little-Endian BigInt from Buffer\n\n## Install\n\n```bash\nnpm install read-bigint\n```\n\n-   [Supported Node versions](./package.json#L24) aim to be\n    [Latest current and LTS](https://nodejs.org/en/download/releases/) as well as trying to keep up to date\n    with the latest supported node in\n    [Google cloud functions](https://cloud.google.com/functions/docs/concepts/nodejs-runtime).\n\n## Usage\n\n```js\nimport {\n    readBigInt64BE,\n    readBigInt64LE,\n    readBigUInt64BE,\n    readBigUInt64LE,\n} from \"read-bigint\";\n\nconst buffer = Buffer.from([\n    0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,\n]);\n\nreadBigInt64BE(buffer, /* offset */ 1); // =\u003e 1234605616436508552n\nreadBigInt64LE(buffer, /* offset */ 1); // =\u003e -8613303245920329199n\nreadBigUInt64BE(buffer, /* offset */ 1); // =\u003e 1234605616436508552n\nreadBigUInt64LE(buffer, /* offset */ 1); // =\u003e 9833440827789222417n\n```\n\nThe purpose of this package is to be able to read native BigInt from native Buffer.\nThis is mostly useful when targeting Node 10 (LTS Dubnium), which supports BigInt, but does not have\nnative methods for reading BigInt from Buffer. On Node 12 or any later version of Node, you should use the\n[native Buffer methods](https://nodejs.org/docs/latest-v13.x/api/buffer.html#buffer_buf_readbigint64be_offset)\ninstead.\n\n## API\n\nEach of the exported methods is a direct copy of the Native Buffer.readBigInt() methods.\n\n-   `readBigInt64BE(buffer, offset)`\n\n    Copy of native\n    [`buffer.readBigInt64BE(offset)`](https://nodejs.org/docs/latest-v13.x/api/buffer.html#buffer_buf_readbigint64be_offset)\n\n-   `readBigInt64LE(buffer, offset)`\n\n    Copy of native\n    [`buffer.readBigInt64LE(offset)`](https://nodejs.org/docs/latest-v13.x/api/buffer.html#buffer_buf_readbigint64le_offset)\n\n-   `readBigUInt64BE(buffer, offset)`\n\n    Copy of native\n    [`buffer.readBigUInt64LE(offset)`](https://nodejs.org/docs/latest-v13.x/api/buffer.html#buffer_buf_readbiguint64be_offset)\n\n-   `readBigUInt64BE(buffer, offset)`\n\n    Copy of native\n    [`buffer.readBigUInt64LE(offset)`](https://nodejs.org/docs/latest-v13.x/api/buffer.html#buffer_buf_readbiguint64be_offset)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobusk%2Fread-bigint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobusk%2Fread-bigint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobusk%2Fread-bigint/lists"}