{"id":25420568,"url":"https://github.com/danielost/big-numbers","last_synced_at":"2025-05-13T16:14:00.919Z","repository":{"id":200010184,"uuid":"704627524","full_name":"danielost/big-numbers","owner":"danielost","description":"BigNumber implementation in Golang","archived":false,"fork":false,"pushed_at":"2023-10-17T18:48:05.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T19:48:51.481Z","etag":null,"topics":["bignumber","cryptography"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielost.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-13T17:14:14.000Z","updated_at":"2023-10-25T12:25:33.000Z","dependencies_parsed_at":"2023-10-15T07:45:27.125Z","dependency_job_id":"54856388-5fea-4a27-8728-9d0f24f5ecf9","html_url":"https://github.com/danielost/big-numbers","commit_stats":null,"previous_names":["danielost/big-numbers"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielost%2Fbig-numbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielost%2Fbig-numbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielost%2Fbig-numbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielost%2Fbig-numbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielost","download_url":"https://codeload.github.com/danielost/big-numbers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253980063,"owners_count":21994043,"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":["bignumber","cryptography"],"created_at":"2025-02-16T19:48:11.122Z","updated_at":"2025-05-13T16:14:00.900Z","avatar_url":"https://github.com/danielost.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Big Numbers\nCryptography for developers by Distributed Lab - Practice #2\n\n## Work done\n* `src/bignumbers.go` - the implementation of a Big Number.\n\n* `src/uint.go` - the data type used by `BigNumber`. Just a convenience that lets you convert a `uint64` to different notations and perform basic binary and arithmetic operations.\n\n* `arithmeticops.go/binaryops.go` - interfaces that the `BigNumber` needs to implement. \n\n* `src/util` - utility functions.\n\n* `src/validators` - set of functions to validate values.\n\n* `tests/` - contains the tests.\n\n## List of operations\n| **#** \t| **Operation** \t| **Name** \t|\n|---\t|---\t|---\t|\n| 1 \t| INV \t| bitwise inversion \t|\n| 2 \t| XOR \t| bitwise exclusive or \t|\n| 3 \t| OR \t| bitwise or \t|\n| 4 \t| AND \t| bitwise and \t|\n| 5 \t| shiftR \t| shift to the right by n bits \t|\n| 6 \t| shiftL \t| shift to the left by n bits \t|\n| 7 \t| ADD \t| addition \t|\n| 8 \t| SUB \t| subtraction \t|\n| 9 \t| MOD \t| modulo \t|\n\n## Testing\n\nTo run the tests, execute one of the following commands in the root folder:\n\n```bash\ngo test .\\tests\\\n```\n```bash\ngo test -v .\\tests\\\n```\n\nWhen pushing, all the tests run automatically with the GitHub Actions.\n\n## Example\n\n```go\nimport (\n\t\"fmt\"\n\n\tbignumbers \"github.com/danielost/big-numbers/src\"\n)\n\nfunc foo() {\n\tvar bnA bignumbers.BigNumber\n\tvar bnB bignumbers.BigNumber\n\n\tbnA.SetHex(\"51bf608414ad5726a3c1bec098f77b1b54ffb2787f8d528a74c1d7fde6470ea4\")\n\tbnB.SetHex(\"403db8ad88a3932a0b7e8189aed9eeffb8121dfac05c3512fdb396dd73f6331c\")\n\n\tbnC := bnA.XOR(bnB)\n\tfmt.Println(bnC.GetHex())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielost%2Fbig-numbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielost%2Fbig-numbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielost%2Fbig-numbers/lists"}