util_accid
Convert an r-address into a 20 byte Account ID
Behaviour
Read an r-address from the
read_ptr
Write a 20 byte Account ID to the
write_ptr
Definition
C
Example
C
Parameters
write_ptr
uint32_t
Pointer to a buffer of a suitable size to store the output Account ID. Must be at least 20 bytes.
write_len
uint32_t
Length of the output buffer.
read_ptr
uint32_t
Pointer to the r-address.
read_len
uint32_t
The length of the r-address.
Return Code
int64_t
The number of bytes written (the length of the output r-address).
If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.
INVALID_ARGUMENT
- read_ptr
pointed at something which wasn't a valid r-address.
TOO_SMALL
- write_len
was not large enough to store produced Account ID. (Should be 20 bytes).
TOO_BIG
- read_len
was longer than an r-address can be.
Last updated