{"id":45207915,"url":"https://github.com/gsknnft/bigint-buffer","last_synced_at":"2026-02-20T16:02:41.275Z","repository":{"id":320658082,"uuid":"1082932740","full_name":"gsknnft/bigint-buffer","owner":"gsknnft","description":"💪🔢 @gsknnft/bigint-buffer: Secure Buffer Utilities for TC39 BigInt Proposal","archived":false,"fork":false,"pushed_at":"2025-12-19T22:35:25.000Z","size":3395,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-22T09:43:30.218Z","etag":null,"topics":["bignum","binary","buffer","crypto","esm","napi","nodejs","polyfill","serialization","solana","tc39-bigint","web3"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gsknnft.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T02:43:21.000Z","updated_at":"2025-12-19T22:11:18.000Z","dependencies_parsed_at":"2025-10-25T04:33:23.211Z","dependency_job_id":null,"html_url":"https://github.com/gsknnft/bigint-buffer","commit_stats":null,"previous_names":["gsknnft/bigint-buffer"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/gsknnft/bigint-buffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsknnft%2Fbigint-buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsknnft%2Fbigint-buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsknnft%2Fbigint-buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsknnft%2Fbigint-buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gsknnft","download_url":"https://codeload.github.com/gsknnft/bigint-buffer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsknnft%2Fbigint-buffer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bignum","binary","buffer","crypto","esm","napi","nodejs","polyfill","serialization","solana","tc39-bigint","web3"],"created_at":"2026-02-20T16:02:40.456Z","updated_at":"2026-02-20T16:02:41.267Z","avatar_url":"https://github.com/gsknnft.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @gsknnft/bigint-buffer\n\n[![NPM Version](https://img.shields.io/npm/v/@gsknnft/bigint-buffer.svg?style=flat-square)](https://www.npmjs.com/package/@gsknnft/bigint-buffer)\n[![Node Version](https://img.shields.io/node/v/@gsknnft/bigint-buffer.svg?style=flat-square)](https://nodejs.org)\n\nBigInt \u003c-\u003e Buffer conversion with native bindings, fast JS fallback paths, and built-in conversion helpers.\n\n## Install\n\n```bash\nnpm install @gsknnft/bigint-buffer\n```\n\n## Quick Start\n\n```ts\nimport {\n  toBigIntBE,\n  toBigIntLE,\n  toBufferBE,\n  toBufferLE,\n  bigintToHex,\n  hexToBigint,\n  bigintToBase64,\n  base64ToBigint,\n} from \"@gsknnft/bigint-buffer\";\n\nconst value = toBigIntBE(Buffer.from(\"deadbeef\", \"hex\"));\nconst out = toBufferLE(value, 8);\n\nconst hex = bigintToHex(123456789n); // \"075bcd15\"\nconst roundTrip = hexToBigint(hex);\n\nconst b64 = bigintToBase64(123456789n);\nconst fromB64 = base64ToBigint(b64);\n```\n\n## FixedPoint Helpers\n\n```ts\nimport {\n  toFixedPoint,\n  fromFixedPoint,\n  addFixedPoint,\n  subtractFixedPoint,\n  averageFixedPoint,\n  compareFixedPoint,\n} from \"@gsknnft/bigint-buffer\";\n\nconst a = toFixedPoint(12.34, 9);\nconst b = toFixedPoint(7.66, 9);\nconst sum = addFixedPoint(a, b);\nconst avg = averageFixedPoint([a, b]);\nconst cmp = compareFixedPoint(a, b);\nconst n = fromFixedPoint(sum, 9);\n```\n\n## Native Loading\n\nThe package tries native first, then falls back to JS:\n\n1. `node-gyp-build` prebuild lookup from installed package root\n2. `bindings` lookup with explicit `module_root` when resolvable\n3. pure JS fallback\n\nSet `BIGINT_BUFFER_NATIVE_PATH` to override lookup root when needed.\n\nEnable debug logging:\n\n```bash\nBIGINT_BUFFER_DEBUG=1 node your-app.js\n```\n\nSilence fallback warning:\n\n```bash\nBIGINT_BUFFER_SILENT_NATIVE_FAIL=1 node your-app.js\n```\n\n## Electron Packaging\n\nInclude the native binary in unpacked resources:\n\n- `node_modules/@gsknnft/bigint-buffer/build/Release/bigint_buffer.node`\n\nCommon location at runtime:\n\n- `resources/app.asar.unpacked/node_modules/@gsknnft/bigint-buffer/build/Release/bigint_buffer.node`\n\nIf your packager relocates native files, set `BIGINT_BUFFER_NATIVE_PATH` to the directory containing `build/Release/bigint_buffer.node`.\n\n## Browser Notes\n\nThis package supports browser builds via fallback paths and conversion bundles.\n\nIf your bundler does not polyfill Node globals/modules automatically, add polyfills for:\n\n- `Buffer`\n- `path`\n- `fs`\n\n## Exports\n\nTop-level package exports:\n\n- ESM: `dist/index.js`\n- CJS: `dist/index.cjs`\n- Types: `dist/index.d.ts`\n- Native binary export: `./build/Release/bigint_buffer.node`\n- Conversion subpath: `@gsknnft/bigint-buffer/conversion`\n\n## Commands\n\n```bash\nnpm run build        # bundle + declarations + conversion sync + native sync\nnpm run compile      # build + typecheck\nnpm test             # vitest\nnpm run check        # eslint\nnpm run rebuild      # node-gyp rebuild + build + conversion build\nnpm run prebuilds    # prebuildify for native binaries\n```\n\nInternal build scripts (`scripts/*.ts`) are executed via `tsx` for stable ESM compatibility in local and CI environments.\n\n## Quality Snapshot\n\nLatest local run (Node 24, Vitest v4, v8 coverage):\n\n- Tests: `141 passed`\n- Coverage: `Statements 84.15%`, `Branches 72.36%`, `Functions 88.37%`, `Lines 85.88%`\n- Benchmark snapshot: see `benchmark.md`\n- Publish dry-run: clean tarball (no test/bench JS artifacts)\n\nReproduce:\n\n```bash\npnpm exec vitest run --coverage --pool=forks\npnpm run benchmark\npnpm pack --dry-run\n```\n\n## Runtime Compatibility\n\n- Node: `\u003e=20`\n- Package format: ESM + CJS\n- Native addon: N-API (`bigint_buffer.node`)\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsknnft%2Fbigint-buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsknnft%2Fbigint-buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsknnft%2Fbigint-buffer/lists"}