Module utils

Source
Expand description

Utilities for binarycodec crate.

Constants§

MAX_BYTE_VALUE
Max value that can be represented using one 8-bit byte (2^8)
MAX_DOUBLE_BYTE_LENGTH
Max length that can be represented in 2 bytes per XRPL serialization encoding.
MAX_DOUBLE_BYTE_VALUE
Max value that can be represented in using two 8-bit bytes (2^16)
MAX_LENGTH_VALUE
Maximum length that can be encoded in a length prefix per XRPL serialization encoding.
MAX_SECOND_BYTE_VALUE
Max value that can be used in the second byte of a length field.
MAX_SINGLE_BYTE_LENGTH
Max length that can be represented in a single byte per XRPL serialization encoding.

Functions§

decode_field_name
Returns the field name represented by the given field ID.
encode_field_name
Returns the unique field ID for a given field name. This field ID consists of the type code and field code, in 1 to 3 bytes depending on whether those values are “common” (<16) or “uncommon” (>=16)