Crates.io | laron-primitives |
lib.rs | laron-primitives |
version | 0.1.0 |
source | src |
created_at | 2022-09-22 06:18:30.880178 |
updated_at | 2022-09-22 06:18:30.880178 |
description | Ethereum primitives for Rust |
homepage | |
repository | https://github.com/laron-tech/primitives |
max_upload_size | |
id | 671476 |
size | 78,604 |
Ethereum primitives type for rust.
This crate was unstable and maybe lot's of bugs and I suggest not to use this.
[dependencies]
laron_primitives = "0.1"
use laron_primitives::*;
let x: U256 = 100u128.into();
let y: U256 = 2u128.into();
let z = x * y;
assert_eq!(200u64, z.into());
To create new type, you can use macro define!
.
use laron_primitives::*;
define!(U512, 64, "512-bits custom type.");
let x: U512 = 100u8.into();
assert_eq!(x * 2u8.into(), 200u8.into());