{"id":21585941,"url":"https://github.com/magiclen/node-int32","last_synced_at":"2025-04-10T20:14:34.567Z","repository":{"id":50768122,"uuid":"94906759","full_name":"magiclen/node-int32","owner":"magiclen","description":"Use Rust to compute 32-bit signed integers and wrap around at the boundary.","archived":false,"fork":false,"pushed_at":"2024-11-26T17:22:13.000Z","size":1781,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T17:55:19.461Z","etag":null,"topics":["int32","nodejs","rust"],"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/magiclen.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":"2017-06-20T15:29:10.000Z","updated_at":"2024-10-22T03:25:50.000Z","dependencies_parsed_at":"2024-10-22T12:35:15.581Z","dependency_job_id":null,"html_url":"https://github.com/magiclen/node-int32","commit_stats":{"total_commits":60,"total_committers":1,"mean_commits":60.0,"dds":0.0,"last_synced_commit":"722e1cd798eafbb8644b9af05eef529c7f5661c3"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fnode-int32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fnode-int32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fnode-int32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fnode-int32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclen","download_url":"https://codeload.github.com/magiclen/node-int32/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288393,"owners_count":21078903,"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":["int32","nodejs","rust"],"created_at":"2024-11-24T15:12:13.498Z","updated_at":"2025-04-10T20:14:34.543Z","avatar_url":"https://github.com/magiclen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Int32\n=================================\n\n[![CI](https://github.com/magiclen/node-int32/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/node-int32/actions/workflows/ci.yml)\n\nUse Rust to compute 32-bit signed integers and wrap around at the boundary.\n\nYou need to set up the Rust development environment: [rustup](https://rustup.rs/)\n\n## Usage\n\n#### add\n\n```typescript\nimport { add } from \"int32\";\n\nconst n = add(1, 2); // 3\n```\n\n#### subtract\n\n```typescript\nimport { subtract } from \"int32\";\n\nconst n = subtract(1, 2); // -1\n```\n\n#### multiply\n\n```typescript\nimport { multiply } from \"int32\";\n\nconst n = multiply(2, 6); // 12\n```\n\n#### divide\n\n```typescript\nimport { divide } from \"int32\";\n\nconst n = divide(6, 4); // 1\n```\n\n#### pow\n\n```typescript\nimport { pow } from \"int32\";\n\nconst n = pow(2, 3); // 8\n```\n\n#### shiftLeft\n\n```typescript\nimport { shiftLeft } from \"int32\";\n\nconst n = shiftLeft(5, 2); // 20\n```\n\n#### shiftRight\n\n```typescript\nimport { shiftRight } from \"int32\";\n\nconst n1 = shiftRight(5, 2); // 1\nconst n2 = shiftRight(6, 1); // 3\nconst n3 = shiftRight(-5, 1); // -3\n```\n\n#### shiftRightUnsigned\n\n```typescript\nimport { shiftRightUnsigned } from \"int32\";\n\nconst n = shiftRightUnsigned(-5, 1); // 2147483645\n```\n\n#### rotateLeft\n\n```typescript\nimport { rotateLeft } from \"int32\";\n\nconst n = rotateLeft(0b10000000000000000000000100000000, 1); // 0b00000000000000000000001000000001\n```\n\n#### rotateRight\n\n```typescript\nimport { rotateRight } from \"int32\";\n\nconst n = rotateRight(0b00000000000000000000000100000001, 8); // 0b00000001000000000000000000000001\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fnode-int32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclen%2Fnode-int32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fnode-int32/lists"}