laron-primitives

Crates.iolaron-primitives
lib.rslaron-primitives
version0.1.0
sourcesrc
created_at2022-09-22 06:18:30.880178
updated_at2022-09-22 06:18:30.880178
descriptionEthereum primitives for Rust
homepage
repositoryhttps://github.com/laron-tech/primitives
max_upload_size
id671476
size78,604
Ade M Ramdani (ademr0)

documentation

README

PRIMITIVES

build License: GPL v3 crates.io

Ethereum primitives type for rust.

This crate was unstable and maybe lot's of bugs and I suggest not to use this.

Usage

[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());

Macro

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());

TODO

  • Add Pow/Exp method for each types.
  • Add SQRT method for each types.
Commit count: 0

cargo fmt