Class Rlp
Utility class for Recursive Length Prefix (RLP) encoding and decoding, used for serializing data in EVM-compatible transactions.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class Rlp
Methods
| Edit this page View SourceDecode(byte[])
Decodes an RLP-encoded byte array into its constituent data items.
Declaration
public static object[] Decode(byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The RLP-encoded byte array to decode. |
Returns
| Type | Description |
|---|---|
| object[] | An array of decoded objects, where each element is either a byte array or a nested array of objects. |
Encode(params object?[])
RLP-encodes one or more data items into a byte array.
Declaration
public static byte[] Encode(params object?[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| object[] | data | The data items to encode. Supports byte arrays, strings, numeric types, and nested arrays. |
Returns
| Type | Description |
|---|---|
| byte[] | The RLP-encoded byte array. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If a data item is of an unsupported type. |