u256-literal

Crates.iou256-literal
lib.rsu256-literal
version1.2.1
sourcesrc
created_at2021-06-17 05:02:03.742834
updated_at2023-01-27 08:06:23.607516
descriptionProcedural macro for converting u256 literals to U256 at compile time.
homepage
repositoryhttps://github.com/guanqun/u256-literal
max_upload_size
id411151
size6,219
Rust (github:microsoft:rust)

documentation

https://docs.rs/u256-literal

README

u256-literal

Description

This crate helps you to declare a constant U256 in an easy way. No need to wrap the integer literal around double quotes.

Usage

use primitive_types::U256;
use u256_literal::u256;

const Q96: U256 = u256!(0x1000000000000000000000000);

// support hex style integer
let x = u256!(0x1234ff);
// support normal style
let y = u256!(987654);
// support float style number
let z = u256!(1.23e18);

License

All crates licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 17

cargo fmt