{"id":13817059,"url":"https://github.com/MaxGraey/as-bignum","last_synced_at":"2025-05-15T19:30:55.826Z","repository":{"id":44586058,"uuid":"136051864","full_name":"MaxGraey/as-bignum","owner":"MaxGraey","description":"Fixed length big numbers for AssemblyScript 🚀","archived":false,"fork":false,"pushed_at":"2025-01-23T19:44:40.000Z","size":3817,"stargazers_count":64,"open_issues_count":12,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-13T11:48:08.385Z","etag":null,"topics":["assemblyscript","bigdecimal","bigint","biginteger","bignum","fixed-point","int128","typescript","u128","u256","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/MaxGraey.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,"zenodo":null}},"created_at":"2018-06-04T16:18:29.000Z","updated_at":"2025-04-30T06:37:56.000Z","dependencies_parsed_at":"2022-08-12T11:20:42.168Z","dependency_job_id":"f12b4742-52cb-4351-8c4b-6bed775ced03","html_url":"https://github.com/MaxGraey/as-bignum","commit_stats":{"total_commits":423,"total_committers":8,"mean_commits":52.875,"dds":"0.049645390070921946","last_synced_commit":"86d3236089d820cb49a16b9ad84dcad1ecfb4bc3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGraey%2Fas-bignum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGraey%2Fas-bignum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGraey%2Fas-bignum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGraey%2Fas-bignum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxGraey","download_url":"https://codeload.github.com/MaxGraey/as-bignum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254407240,"owners_count":22066196,"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":["assemblyscript","bigdecimal","bigint","biginteger","bignum","fixed-point","int128","typescript","u128","u256","wasm","webassembly"],"created_at":"2024-08-04T06:00:32.671Z","updated_at":"2025-05-15T19:30:55.451Z","avatar_url":"https://github.com/MaxGraey.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"[![NPM registry](https://img.shields.io/npm/v/as-bignum.svg?style=for-the-badge)](https://www.npmjs.com/package/as-bignum)[![Build Status](https://img.shields.io/travis/com/MaxGraey/as-bignum/master?style=for-the-badge)](https://travis-ci.com/MaxGraey/as-bignum)[![NPM license](https://img.shields.io/badge/license-Apache%202.0-ba68c8.svg?style=for-the-badge)](LICENSE.md)\n\n## WebAssembly fixed length big numbers written on [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)\n\n### Status: Work in progress\n\nProvide wide numeric types such as `u128`, `u256`, `i128`, `i256` and fixed points and also its arithmetic operations.\n\nNamespace `safe` contain equivalents with overflow/underflow traps.\n\nAll kind of types pretty useful for economical and cryptographic usages and provide deterministic behavior.\n\n### Install\n\n\u003e yarn add as-bignum\n\nor\n\n\u003e npm i as-bignum\n\n### Usage via AssemblyScript\n\n```ts\nimport { u128 } from \"as-bignum/assembly\";\n// Before 0.20.x\n// import { u128 } from \"as-bignum\";\n\ndeclare function logF64(value: f64): void;\ndeclare function logU128(hi: u64, lo: u64): void;\n\nvar a = u128.One;\nvar b = u128.from(-32); // same as u128.from\u003ci32\u003e(-32)\nvar c = new u128(0x1, -0xF);\nvar d = u128.from(0x0123456789ABCDEF); // same as u128.from\u003ci64\u003e(0x0123456789ABCDEF)\nvar e = u128.from('0x0123456789ABCDEF01234567');\nvar f = u128.fromString('11100010101100101', 2); // same as u128.from('0b11100010101100101')\nvar r = d / c + (b \u003c\u003c 5) + e;\n\nlogF64(r.as\u003cf64\u003e());\nlogU128(r.hi, r.lo);\n```\n\n### Usage via JavaScript/Typescript\n\n```ts\nTODO\n```\n\n### List of types\n\n- [x] [`u128`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/u128.ts) unsigned type (tested)\n- [ ] [`u256`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/u256.ts) unsigned type (very basic)\n- [ ] `i128` signed type\n- [ ] `i256` signed type\n\n---\n\n- [x] [`safe.u128`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/integer/safe/u128.ts) unsigned type (tested)\n\n- [ ] `safe.u256` unsigned type\n- [ ] `safe.i128` signed type\n- [ ] `safe.i256` signed type\n\n---\n\n- [ ] [`fp128\u003cQ\u003e`](https://github.com/MaxGraey/as-bignum/blob/master/assembly/fixed/fp128.ts) generic fixed point signed type٭ (very basic for now)\n- [ ] `fp256\u003cQ\u003e` generic fixed point signed type٭\n\n---\n\n- [ ] `safe.fp128\u003cQ\u003e` generic fixed point signed type٭\n- [ ] `safe.fp256\u003cQ\u003e` generic fixed point signed type٭\n\n٭ _typename_ `Q` _is a type representing count of fractional bits_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMaxGraey%2Fas-bignum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMaxGraey%2Fas-bignum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMaxGraey%2Fas-bignum/lists"}