3 unstable releases
0.3.0 | Feb 4, 2020 |
---|---|
0.2.2 | Jun 12, 2019 |
0.2.1 | Jun 2, 2019 |
#3 in #eos
22 downloads per month
Used in 8 crates
(4 directly)
20KB
362 lines
eosio_numstr
This crate provides functions for converting EOSIO names and symbols to and from string representations.
Creating an EOSIO name:
use eosio_numstr::name_from_bytes;
let name = name_from_bytes("eosio".bytes()).unwrap();
assert_eq!(name, 6138663577826885632);
Creating an EOSIO symbol:
use eosio_numstr::symbol_from_bytes;
let symbol = symbol_from_bytes(4, "EOS".bytes()).unwrap();
assert_eq!(symbol, 1162826500);
License: MIT OR Apache-2.0
lib.rs
:
This crate provides functions for converting EOSIO names and symbols to and from string representations.
Creating an EOSIO name:
use eosio_numstr::name_from_bytes;
let name = name_from_bytes("eosio".bytes()).unwrap();
assert_eq!(name, 6138663577826885632);
Creating an EOSIO symbol:
use eosio_numstr::symbol_from_bytes;
let symbol = symbol_from_bytes(4, "EOS".bytes()).unwrap();
assert_eq!(symbol, 1162826500);