[−][src]Crate eosio_numstr
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");
Enums
ParseNameError | An error which can be returned when parsing an EOSIO name. |
ParseSymbolError | An error which can be returned when parsing an EOSIO symbol. |
Constants
NAME_LEN_MAX | The maximum character length of an EOSIO name. |
NAME_UTF8_CHARS | All possible characters that can be used in EOSIO names. |
SYMBOL_LEN_MAX | The maximum allowed length of EOSIO symbol codes. |
SYMBOL_UTF8_CHARS | All possible characters that can be used in EOSIO symbol codes. |
Functions
name_from_chars | Attempts to create an EOSIO name from an |
name_from_str | Attempts to create an EOSIO name from a |
name_to_string | Converts an EOSIO name value into a string. |
name_to_utf8 | Converts an EOSIO name into an array of UTF-8 characters. |
symbol_code | Gets an EOSIO symbol's code. |
symbol_code_length | Gets the length of an EOSIO symbol's code |
symbol_from_chars | Attempts to create an EOSIO symbol from an |
symbol_from_str | Attemps to create an EOSIO symbol from a |
symbol_precision | Gets an EOSIO symbol's precision. |
symbol_to_string | Converts an EOSIO symbol value into a string. |
symbol_to_utf8 | Converts an EOSIO symbol into an array of UTF-8 characters. |