Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Int256 and UInt256 #196

Open
gusinacio opened this issue Sep 18, 2023 · 1 comment
Open

Support for Int256 and UInt256 #196

gusinacio opened this issue Sep 18, 2023 · 1 comment

Comments

@gusinacio
Copy link
Contributor

I'm planning to create a PR for uint256 and int256 but I would like some guidance related to the types.

Rust doesn't implement native i256 neither u256. Should this crate follow the example of klickhouse and implement its own types?

Should we use an external crate like primitive_types?

I'd suggest to create the own types and implement the From trait under a feature flag if needed. This way we don't rely on external crates that don't even implement i256, or have a lot more than needed in this crate.

@gusinacio
Copy link
Contributor Author

gusinacio commented Sep 18, 2023

ethnum may be one external_crate to use. It seems that it's a simple and direct implementation of u256 and i256 without any ethereum types or utils.

From their docs:

The implementation tries to follow as closely as possible to primitive integer types, and should implement all the common methods and traits as the primitive integer types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant