{"id":20629773,"url":"https://github.com/pb2204/int64-node","last_synced_at":"2025-04-15T18:19:08.786Z","repository":{"id":196594994,"uuid":"696617881","full_name":"PB2204/Int64-Node","owner":"PB2204","description":"int64-node is a JavaScript library that provides support for handling 64-bit integer numbers in Node.js.","archived":false,"fork":false,"pushed_at":"2023-09-26T13:09:57.000Z","size":5417,"stargazers_count":20,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T18:18:24.804Z","etag":null,"topics":["collaborate","communityexchange","ghdesktop","github","github-campus-experts","github-codespaces","github-pages","gitkraken","gitlens","hacktoberfest","jetbrains","learn","microsoft","scrimba","student-vscode"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/int64-node","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/PB2204.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-26T05:36:56.000Z","updated_at":"2023-10-08T20:05:10.000Z","dependencies_parsed_at":"2023-09-30T10:50:12.880Z","dependency_job_id":null,"html_url":"https://github.com/PB2204/Int64-Node","commit_stats":null,"previous_names":["pb2204/int64-node"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PB2204%2FInt64-Node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PB2204%2FInt64-Node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PB2204%2FInt64-Node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PB2204%2FInt64-Node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PB2204","download_url":"https://codeload.github.com/PB2204/Int64-Node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249125998,"owners_count":21216705,"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":["collaborate","communityexchange","ghdesktop","github","github-campus-experts","github-codespaces","github-pages","gitkraken","gitlens","hacktoberfest","jetbrains","learn","microsoft","scrimba","student-vscode"],"created_at":"2024-11-16T14:06:00.683Z","updated_at":"2025-04-15T18:19:08.749Z","avatar_url":"https://github.com/PB2204.png","language":"JavaScript","readme":"# int64-node\n\n**int64-node** is a JavaScript library that provides support for handling 64-bit integer numbers in Node.js. JavaScript's native Numbers are represented as IEEE 754 double-precision floats, which limits the range of values that can be accurately represented to `±2^53`. For projects requiring precise 64-bit integer handling, such as [node-thrift](https://github.com/wadey/node-thrift), `int64-node` comes to the rescue.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n- [Contributing](#contributing)\n- [Learning](#learning)\n- [Code of Conduct](#code-of-conduct)\n- [Developer Details](#developer-details)\n\n## Installation\n\nYou can install int64-node via npm:\n\n```bash\nnpm install int64-node\n```\n\n## Usage\n\n### Creating Int64 Instances\n\n```javascript\n// Require the int64-node module\nconst Int64 = require('int64-node');\n\n// Create Int64 instances\nconst int1 = new Int64(0x12345678, 0x9abcdef0);\nconst int2 = new Int64('123456789abcdef0');\n```\n\n### Performing Arithmetic Operations\n\n```javascript\n// Perform arithmetic operations\nconst result1 = int1 + 1; // 4886718346\nconst result2 = int2 + 1; // Infinity\n```\n\n### Converting to Different Representations\n\n```javascript\n// Convert to different representations\nconst octetString1 = int1.toOctetString(); // '0000000123456789'\nconst octetString2 = int2.toOctetString(); // '123456789abcdef0'\nconst binaryString1 = int1.toString(2); // '100100011010001010110011110001001'\nconst binaryString2 = int2.toString(2); // 'Infinity'\n```\n\n### Checking Integer Precision\n\n```javascript\n// Check if the value is within integer-precise range\nconst isInt1Finite = isFinite(int1); // true\nconst isInt2Finite = isFinite(int2); // false\n```\n\n### Copying to a Buffer\n\n```javascript\n// Copy to a buffer\nconst buffer1 = int1.toBuffer(); // \u003cBuffer 12 34 56 78 9a bc de f0\u003e\nconst buffer2 = new Buffer(16);\nint2.copy(buffer2, 0); // Copies the Int64 value to the buffer\n```\n\n### Creating Int64 Instances from a Buffer\n\n```javascript\n// Create Int64 instances from a Buffer\nconst intFromBuffer = new Int64(new Buffer([0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0]));\n\n// Create Int64 instances from a Buffer with an offset\nconst intFromOffset = new Int64(new Buffer([0, 0, 0, 0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0]), 4);\n```\n\n## License\n\nint64-node is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n## Contributing\n\nInterested in contributing? Please read our [Contributing Guidelines](CONTRIBUTING.md) for more information.\n\n## Learning\n\nExplore our [Learning Resources](LEARN.md) to get started with int64-node.\n\n## Code of Conduct\n\nPlease follow our [Code of Conduct](CODE_OF_CONDUCT.md) to ensure a welcoming and inclusive community.\n\n## Developer Details\n\n- Author: [Pabitra Banerjee](https://pabitrabanerjee.me)\n- Email: [rockstarpabitra2204@gmail.com](mailto:rockstarpabitra2204@gmail.com)\n- GitHub: [PB2204](https://github.com/PB2204)\n\n## Happy Coding 🚀","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpb2204%2Fint64-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpb2204%2Fint64-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpb2204%2Fint64-node/lists"}