{"id":22191965,"url":"https://github.com/cryptape/rust-numext","last_synced_at":"2025-07-09T18:06:37.061Z","repository":{"id":56578603,"uuid":"152507395","full_name":"cryptape/rust-numext","owner":"cryptape","description":"Extend the rust built-in numeric types.","archived":false,"fork":false,"pushed_at":"2020-10-30T13:33:01.000Z","size":435,"stargazers_count":32,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2024-11-16T23:08:03.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/cryptape.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-11T00:31:21.000Z","updated_at":"2023-03-06T15:13:38.000Z","dependencies_parsed_at":"2022-08-15T21:20:31.706Z","dependency_job_id":null,"html_url":"https://github.com/cryptape/rust-numext","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptape%2Frust-numext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptape%2Frust-numext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptape%2Frust-numext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptape%2Frust-numext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryptape","download_url":"https://codeload.github.com/cryptape/rust-numext/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227724139,"owners_count":17810036,"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":[],"created_at":"2024-12-02T12:18:32.518Z","updated_at":"2024-12-02T12:18:33.071Z","avatar_url":"https://github.com/cryptape.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust-NumExt\n\n[![License]](#license)\n[![Travis CI]](https://travis-ci.com/cryptape/rust-numext)\n[![AppVeyor]](https://ci.appveyor.com/project/cryptape/rust-numext)\n\nExtend the rust built-in numeric types.\n\n[License]: https://img.shields.io/badge/License-Apache--2.0%20OR%20MIT-blue.svg\n[Travis CI]: https://img.shields.io/travis/com/cryptape/rust-numext.svg\n[AppVeyor]: https://ci.appveyor.com/api/projects/status/github/cryptape/rust-numext?branch=master\u0026svg=true\n\n## Crates\n\n| Name                   | Crate                                                               | Documentation                                            | Description                 |\n| ---------------------- | ------------------------------------------------------------------- | -------------------------------------------------------- | --------------------------- |\n| [`numext-fixed-uint`]  | [![Uint Badge]](https://crates.io/crates/numext-fixed-uint)         | [![Uint Doc]](https://docs.rs/numext-fixed-uint)         | Fixed-size uint structures. |\n| [`numext-fixed-hash`]  | [![Hash Badge]](https://crates.io/crates/numext-fixed-hash)         | [![Hash Doc]](https://docs.rs/numext-fixed-hash)         | Fixed-size hash structures. |\n\n[`numext-fixed-uint`]: fixed-uint\n[`numext-fixed-hash`]: fixed-hash\n\n[Uint Badge]: https://img.shields.io/crates/v/numext-fixed-uint.svg\n[Hash Badge]: https://img.shields.io/crates/v/numext-fixed-hash.svg\n\n[Uint Doc]: https://docs.rs/numext-fixed-uint/badge.svg\n[Hash Doc]: https://docs.rs/numext-fixed-hash/badge.svg\n\n## Requirements\n\n- `rustc 1.45.0+`.\n\n  Require [Stabilizing function-like procedural macros in expressions, patterns, and statements](https://blog.rust-lang.org/2020/07/16/Rust-1.45.0.html#stabilizing-function-like-procedural-macros-in-expressions-patterns-and-statements).\n\n## Benchmark\n\n### Howto\n\n```\ncargo bench\n```\n\n### Results on Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz\n\n- `+` means better; `-` means worse.\n- `nfuint` and `nfhash` is short for [`numext-fixed-uint`] and [`numext-fixed-hash`].\n- `etypes` is short for [`ethereum-types`](https://crates.io/crates/ethereum-types).\n\nSerialization / Deserialization Benchmark:\n```diff\n+serde/ser/nfhash/h256   time:   [56.812 ns 56.834 ns 56.855 ns]\n-serde/ser/etypes/h256   time:   [101.41 ns 102.24 ns 103.30 ns]\n+serde/de/nfhash/h256    time:   [96.613 ns 96.643 ns 96.672 ns]\n-serde/de/etypes/h256    time:   [160.63 ns 160.73 ns 160.89 ns]\n\n-serde/ser/nfuint/u256   time:   [114.36 ns 114.66 ns 115.14 ns]\n+serde/ser/etypes/u256   time:   [102.49 ns 102.55 ns 102.59 ns]\n+serde/de/nfuint/u256    time:   [117.83 ns 117.85 ns 117.88 ns]\n-serde/de/etypes/u256    time:   [175.12 ns 175.20 ns 175.29 ns]\n```\n\nCalculation Benchmark:\n```diff\n+gcd/nfuint              time:   [2.7441 us 2.7444 us 2.7447 us]\n-gcd/num_bigint          time:   [6.9668 us 6.9683 us 6.9697 us]\n\n+add/nfuint              time:   [2.7960 ns 2.8020 ns 2.8067 ns]\n-add/etypes              time:   [4.9120 ns 4.9152 ns 4.9183 ns]\n+sub/nfuint              time:   [2.7734 ns 2.7812 ns 2.7884 ns]\n-sub/etypes              time:   [4.9641 ns 4.9679 ns 4.9715 ns]\n+mul/nfuint              time:   [13.786 ns 13.788 ns 13.790 ns]\n-mul/etypes              time:   [14.946 ns 14.950 ns 14.956 ns]\n+div/nfuint              time:   [25.820 ns 25.826 ns 25.832 ns]\n-div/etypes              time:   [77.297 ns 77.300 ns 77.304 ns]\n+rem/nfuint              time:   [26.454 ns 26.455 ns 26.458 ns]\n-rem/etypes              time:   [72.860 ns 72.902 ns 72.958 ns]\n+bitand/nfuint           time:   [3.6945 ns 3.6946 ns 3.6947 ns]\n-bitand/etypes           time:   [5.3184 ns 5.3224 ns 5.3267 ns]\n+bitor/nfuint            time:   [3.6945 ns 3.6947 ns 3.6948 ns]\n-bitor/etypes            time:   [5.3298 ns 5.3323 ns 5.3347 ns]\n+bitxor/nfuint           time:   [3.6944 ns 3.6946 ns 3.6947 ns]\n-bitxor/etypes           time:   [5.3315 ns 5.3342 ns 5.3367 ns]\n+not/nfuint              time:   [2.3861 ns 2.3867 ns 2.3873 ns]\n-not/etypes              time:   [3.8522 ns 3.8526 ns 3.8530 ns]\n\n+shift/left/0/nfuint     time:   [2.4974 ns 2.4978 ns 2.4981 ns]\n-shift/left/0/etypes     time:   [9.7666 ns 9.7678 ns 9.7692 ns]\n+shift/left/7/nfuint     time:   [2.5193 ns 2.5196 ns 2.5199 ns]\n-shift/left/7/etypes     time:   [12.425 ns 12.426 ns 12.428 ns]\n+shift/left/65/nfuint    time:   [2.2779 ns 2.2832 ns 2.2905 ns]\n-shift/left/65/etypes    time:   [11.685 ns 11.725 ns 11.775 ns]\n+shift/left/511/nfuint   time:   [1.9075 ns 1.9083 ns 1.9091 ns]\n-shift/left/511/etypes   time:   [5.6710 ns 5.6788 ns 5.6893 ns]\n\n+shift/right/0/nfuint    time:   [2.4972 ns 2.4977 ns 2.4981 ns]\n-shift/right/0/etypes    time:   [9.7640 ns 9.7645 ns 9.7651 ns]\n+shift/right/7/nfuint    time:   [2.5281 ns 2.5284 ns 2.5286 ns]\n-shift/right/7/etypes    time:   [12.409 ns 12.410 ns 12.411 ns]\n+shift/right/65/nfuint   time:   [2.3753 ns 2.3755 ns 2.3757 ns]\n-shift/right/65/etypes   time:   [11.878 ns 11.879 ns 11.880 ns]\n+shift/right/511/nfuint  time:   [1.9077 ns 1.9088 ns 1.9098 ns]\n-shift/right/511/etypes  time:   [5.7064 ns 5.7336 ns 5.7679 ns]\n```\n\n## License\n\nLicensed under either of [Apache License, Version 2.0] or [MIT License], at\nyour option.\n\n[Apache License, Version 2.0]: LICENSE-APACHE\n[MIT License]: LICENSE-MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptape%2Frust-numext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptape%2Frust-numext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptape%2Frust-numext/lists"}