2 releases

✓ Uses Rust 2018 edition

new 0.2.2 Jun 12, 2019
0.2.1 Jun 2, 2019

#1 in #eosio

7 downloads per month
Used in 3 crates (2 directly)

MIT/Apache

15KB
189 lines

This crate provides functions for converting EOSIO names and symbols, represented as u64, to and from string representations.

Converting names:

use eosio_numstr::{name_from_str, name_to_string};

let name = name_from_str("eosio").unwrap();
assert_eq!(name, 6138663577826885632);
assert_eq!(name_to_string(name), "eosio");

Converting symbols:

use eosio_numstr::{symbol_from_str, symbol_to_string};

let symbol = symbol_from_str(4, "EOS").unwrap();
assert_eq!(symbol, 1397703940);
assert_eq!(symbol_to_string(symbol), "EOS");

lib.rs:

This crate provides functions for converting EOSIO names and symbols, represented as u64, to and from string representations.

Converting names:

use eosio_numstr::{name_from_str, name_to_string};

let name = name_from_str("eosio").unwrap();
assert_eq!(name, 6138663577826885632);
assert_eq!(name_to_string(name), "eosio");

Converting symbols:

use eosio_numstr::{symbol_from_str, symbol_to_string};

let symbol = symbol_from_str(4, "EOS").unwrap();
assert_eq!(symbol, 1397703940);
assert_eq!(symbol_to_string(symbol), "EOS");

No runtime deps