Expand description
Utilities for formatting and parsing Urbit’s @p and @q data types (patp/patq).
Enums§
- Error
- Parsing and Formatting errors
Constants§
- PREFIXES
- Ordered list of all prefixes. Use to lookup a prefix by numerical value.
- SUFFIXES
- Ordered list of all suffixes. Use to lookup a suffix by numerical value.
Statics§
- PREFIX_
VALUES - Map from prefix name to integer value. Use to validate a prefix or lookup the numeric value.
- SUFFIX_
VALUES - Map from suffix name to integer value. Use to validate a suffix or lookup the numeric value.
Functions§
- big2patp
- Convert a bignum (UBig) to a @p-encoded string.
- big2patq
- Convert a bignum (UBig) into a @q-encoded string.
- buf2pat
- General formatter for @p and @q encoded strings.
- buf2patp
- Convert a Buffer into a @p-encoded string.
- buf2patq
- Convert a Buffer into a @q-encoded string.
- clan
- Determine the ship class of a @p value.
- dec2patp
- Convert a decimal encoded string to a @q-encoded string.
- dec2patq
- Convert a decimal encoded string to a @q-encoded string.
- eq_patq
- Equality test for a @p and @q.
- hex2patp
- Convert a hex-encoded string to a @p-encoded string.
- hex2patq
- Convert a hex-encoded string to a @q-encoded string.
- is_
valid_ pat - General validation for pat type values.
- is_
valid_ patp - Validate a @p-encoded string.
- is_
valid_ patq - Validate a @q-encoded string.
- pat2syls
- General parser for @p and @q values.
- patp
- Convert an unsigned integer into a @p-encoded string.
- patp2big
- Convert a @p-encoded string to a UBig
- patp2dec
- Convert a @p-encoded string to a decimal-encoded string.
- patp2hex
- Convert a @p-encoded string to a hex-encoded string.
- patp2int
- Convert a @p-encoded string to a primitive integer
- patp2syls
- Parse a @p-encoded value into a vector of individual syllables
- patq
- Convert an unsigned integer into a @q-encoded string.
- patq2big
- Convert a @q-encoded string to a UBig
- patq2dec
- Convert a @q-encoded string to a decimal-encoded string.
- patq2hex
- Convert a @q-encoded string to a hex-encoded string.
- patq2int
- Convert a @q-encoded string to a primitive integer
- patq2syls
- Parse a @q-encoded value into a vector of individual syllables
- prefix_
value - Get a prefix value with validation
- sein
- Determine the parent of a @p value.
- static_
pre - Validate the input as a prefix, and return a static copy
- static_
suf - Validate the input as a suffix, and return a static copy
- suffix_
value - Get a suffix value with validation
- syls2buffer
- Convert syllables into a buffer of their integer values.