class SSZ
(source)
Simple Serialize (SSZ) encoding and decoding.
static fun <T : Any> decode(source: Bytes, fn: Function<SSZReader, T>): T
Read and decode SSZ from a Bytes value. |
|
static fun decodeAddress(source: Bytes): Bytes
Read a 20-byte address from the SSZ source. |
|
static fun decodeAddressList(source: Bytes): MutableList<Bytes>
Read a list of 20-byte addresses from the SSZ source. |
|
static fun decodeBigInteger(source: Bytes, bitLength: Int): BigInteger
Read a SSZ encoded two's-compliment big integer from a Bytes value. |
|
static fun decodeBigIntegerList(source: Bytes, bitLength: Int): MutableList<BigInteger>
Read a list of two's-compliment big integer values from the SSZ source. |
|
static fun decodeBoolean(source: Bytes): Boolean
Read a boolean value from the SSZ source. |
|
static fun decodeBooleanList(source: Bytes): MutableList<Boolean>
Read a list of booleans from the SSZ source. |
|
static fun decodeByteArrayList(source: Bytes): MutableList<ByteArray>
Read a list of byte arrays from the SSZ source. Note: prefer to use static fun decodeByteArrayList(source: Bytes, limit: Int): MutableList<ByteArray>
Read a list of byte arrays from the SSZ source. |
|
static fun decodeBytes(source: Bytes): Bytes
Read a SSZ encoded bytes from a Bytes value. Note: prefer to use static fun decodeBytes(source: Bytes, limit: Int): Bytes
Read a SSZ encoded bytes from a Bytes value. |
|
static fun decodeBytesList(source: Bytes): MutableList<Bytes>
Read a list of Bytes from the SSZ source. Note: prefer to use static fun decodeBytesList(source: Bytes, limit: Int): MutableList<Bytes>
Read a list of Bytes from the SSZ source. |
|
static fun decodeHash(source: Bytes, hashLength: Int): Bytes
Read a 32-byte hash from the SSZ source. |
|
static fun decodeHashList(source: Bytes, hashLength: Int): MutableList<Bytes>
Read a list of 32-byte hashes from the SSZ source. |
|
static fun decodeInt(source: Bytes, bitLength: Int): Int
Read a SSZ encoded two's-compliment integer from a Bytes value. |
|
static fun decodeInt16(source: Bytes): Int
Read a 16-bit two's-compliment integer from the SSZ source. |
|
static fun decodeInt16List(source: Bytes): MutableList<Int>
Read a list of 16-bit two's-compliment int values from the SSZ source. |
|
static fun decodeInt32(source: Bytes): Int
Read a 32-bit two's-compliment integer from the SSZ source. |
|
static fun decodeInt32List(source: Bytes): MutableList<Int>
Read a list of 32-bit two's-compliment int values from the SSZ source. |
|
static fun decodeInt64(source: Bytes): Long
Read a 64-bit two's-compliment integer from the SSZ source. |
|
static fun decodeInt64List(source: Bytes): MutableList<Long>
Read a list of 64-bit two's-compliment int values from the SSZ source. |
|
static fun decodeInt8(source: Bytes): Int
Read an 8-bit two's-compliment integer from the SSZ source. |
|
static fun decodeInt8List(source: Bytes): MutableList<Int>
Read a list of 8-bit two's-compliment int values from the SSZ source. |
|
static fun decodeIntList(source: Bytes, bitLength: Int): MutableList<Int>
Read a list of two's-compliment int values from the SSZ source. |
|
static fun decodeLong(source: Bytes, bitLength: Int): Long
Read a SSZ encoded two's-compliment long integer from a Bytes value. |
|
static fun decodeLongIntList(source: Bytes, bitLength: Int): MutableList<Long>
Read a list of two's-compliment long int values from the SSZ source. |
|
static fun decodeString(source: Bytes): String
Read a SSZ encoded string from a Bytes value. Note: prefer to use static fun decodeString(source: Bytes, limit: Int): String
Read a SSZ encoded string from a Bytes value. |
|
static fun decodeStringList(source: Bytes): MutableList<String>
Read a list of strings from the SSZ source. Note: prefer to use static fun decodeStringList(source: Bytes, limit: Int): MutableList<String>
Read a list of strings from the SSZ source. |
|
static fun decodeUInt(source: Bytes, bitLength: Int): Int
Read a SSZ encoded unsigned integer from a Bytes value. |
|
static fun decodeUInt16(source: Bytes): Int
Read a 16-bit unsigned integer from the SSZ source. |
|
static fun decodeUInt16List(source: Bytes): MutableList<Int>
Read a list of 16-bit unsigned int values from the SSZ source. |
|
static fun decodeUInt256(source: Bytes): UInt256
Read a 256-bit unsigned integer from the SSZ source. |
|
static fun decodeUInt256List(source: Bytes): MutableList<UInt256>
Read a list of 256-bit unsigned int values from the SSZ source. |
|
static fun decodeUInt32(source: Bytes): Long
Read a 32-bit unsigned integer from the SSZ source. |
|
static fun decodeUInt32List(source: Bytes): MutableList<Long>
Read a list of 32-bit unsigned int values from the SSZ source. |
|
static fun decodeUInt384(source: Bytes): UInt384
Read a 384-bit unsigned integer from the SSZ source. |
|
static fun decodeUInt384List(source: Bytes): MutableList<UInt384>
Read a list of 384-bit unsigned int values from the SSZ source. |
|
static fun decodeUInt64(source: Bytes): Long
Read a 64-bit unsigned integer from the SSZ source. |
|
static fun decodeUInt64List(source: Bytes): MutableList<Long>
Read a list of 64-bit unsigned int values from the SSZ source. |
|
static fun decodeUInt8(source: Bytes): Int
Read an 8-bit unsigned integer from the SSZ source. |
|
static fun decodeUInt8List(source: Bytes): MutableList<Int>
Read a list of 8-bit unsigned int values from the SSZ source. |
|
static fun decodeUIntList(source: Bytes, bitLength: Int): MutableList<Int>
Read a list of unsigned int values from the SSZ source. |
|
static fun decodeULong(source: Bytes, bitLength: Int): Long
Read a SSZ encoded unsigned long integer from a Bytes value. |
|
static fun decodeULongIntList(source: Bytes, bitLength: Int): MutableList<Long>
Read a list of unsigned long int values from the SSZ source. |
|
static fun decodeUnsignedBigInteger(source: Bytes, bitLength: Int): BigInteger
Read a SSZ encoded unsigned big integer from a Bytes value. |
|
static fun decodeUnsignedBigIntegerList(source: Bytes, bitLength: Int): MutableList<BigInteger>
Read a list of unsigned big integer values from the SSZ source. |
|
static fun encode(fn: Consumer<SSZWriter>): Bytes
Encode values to a Bytes value. |
|
static fun encodeAddress(address: Bytes): Bytes
Encode a 20-byte address to a Bytes value. |
|
static fun encodeAddressList(vararg elements: Bytes): Bytes static fun encodeAddressList(elements: MutableList<out Bytes>): Bytes
Encode a list of addresses. |
|
static fun encodeBigInteger(value: BigInteger, bitLength: Int): Bytes
Encode a big integer to a Bytes value. |
|
static fun encodeBigIntegerList(bitLength: Int, vararg elements: BigInteger): Bytes static fun encodeBigIntegerList(bitLength: Int, elements: MutableList<BigInteger>): Bytes
Encode a list of big integers. |
|
static fun encodeBigIntegerToByteArray(value: BigInteger, bitLength: Int): ByteArray |
|
static fun encodeBoolean(value: Boolean): Bytes
Encode a boolean to a Bytes value. |
|
static fun encodeBooleanList(vararg elements: Boolean): Bytes static fun encodeBooleanList(elements: MutableList<Boolean>): Bytes
Encode a list of booleans. |
|
static fun encodeByteArray(value: ByteArray): Bytes
Encode a value to a Bytes value. |
|
static fun encodeBytes(value: Bytes): Bytes
Encode Bytes. |
|
static fun encodeBytesList(vararg elements: Bytes): Bytes static fun encodeBytesList(elements: MutableList<out Bytes>): Bytes
Encode a list of bytes. |
|
static fun encodeHash(hash: Bytes): Bytes
Encode a hash to a Bytes value. |
|
static fun encodeHashList(vararg elements: Bytes): Bytes static fun encodeHashList(elements: MutableList<out Bytes>): Bytes
Encode a list of hashes. |
|
static fun encodeInt(value: Int, bitLength: Int): Bytes
Encode a two's-compliment integer to a Bytes value. |
|
static fun encodeInt16(value: Int): Bytes
Encode a 16-bit two's-compliment integer to a Bytes value. |
|
static fun encodeInt16List(vararg elements: Int): Bytes static fun encodeInt16List(elements: MutableList<Int>): Bytes
Encode a list of 16-bit two's compliment integers. |
|
static fun encodeInt32(value: Int): Bytes
Encode a 32-bit two's-compliment integer to a Bytes value. |
|
static fun encodeInt32List(vararg elements: Int): Bytes static fun encodeInt32List(elements: MutableList<Int>): Bytes
Encode a list of 32-bit two's compliment integers. |
|
static fun encodeInt64(value: Long): Bytes
Encode a 64-bit two's-compliment integer to a Bytes value. |
|
static fun encodeInt64List(vararg elements: Long): Bytes static fun encodeInt64List(elements: MutableList<Long>): Bytes
Encode a list of 64-bit two's compliment integers. |
|
static fun encodeInt8(value: Int): Bytes
Encode an 8-bit two's-compliment integer to a Bytes value. |
|
static fun encodeInt8List(vararg elements: Int): Bytes static fun encodeInt8List(elements: MutableList<Int>): Bytes
Encode a list of 8-bit two's compliment integers. |
|
static fun encodeIntList(bitLength: Int, vararg elements: Int): Bytes static fun encodeIntList(bitLength: Int, elements: MutableList<Int>): Bytes
Encode a list of two's compliment integers. |
|
static fun encodeLong(value: Long, bitLength: Int): Bytes
Encode a two's-compliment long integer to a Bytes value. |
|
static fun encodeLongIntList(bitLength: Int, vararg elements: Long): Bytes static fun encodeLongIntList(bitLength: Int, elements: MutableList<Long>): Bytes
Encode a list of two's compliment long integers. |
|
static fun encodeString(str: String): Bytes
Encode a string to a Bytes value. |
|
static fun encodeStringList(vararg elements: String): Bytes
Encode a list of strings. static fun encodeStringList(elements: MutableList<String>): Bytes
Encode a list of strings |
|
static fun <T : ByteBuffer> encodeTo(buffer: T, fn: Consumer<SSZWriter>): T
Encode values to a ByteBuffer. |
|
static fun encodeUBigInteger(value: BigInteger, bitLength: Int): Bytes
Encode an unsigned big integer to a Bytes value. |
|
static fun encodeUBigIntegerToByteArray(value: BigInteger, bitLength: Int): ByteArray |
|
static fun encodeUInt(value: Int, bitLength: Int): Bytes
Encode an unsigned integer to a Bytes value. Note that |
|
static fun encodeUInt16(value: Int): Bytes
Encode a 16-bit unsigned integer to a Bytes value. |
|
static fun encodeUInt16List(vararg elements: Int): Bytes static fun encodeUInt16List(elements: MutableList<Int>): Bytes
Encode a list of 16-bit unsigned integers. |
|
static fun encodeUInt256(value: UInt256): Bytes
Encode a 256-bit unsigned integer to a little-endian Bytes value. |
|
static fun encodeUInt256List(vararg elements: UInt256): Bytes static fun encodeUInt256List(elements: MutableList<UInt256>): Bytes
Encode a list of UInt256. |
|
static fun encodeUInt32(value: Long): Bytes
Encode a 32-bit unsigned integer to a Bytes value. |
|
static fun encodeUInt32List(vararg elements: Long): Bytes static fun encodeUInt32List(elements: MutableList<Long>): Bytes
Encode a list of 32-bit unsigned integers. |
|
static fun encodeUInt384(value: UInt384): Bytes
Encode a 384-bit unsigned integer to a little-endian Bytes value. |
|
static fun encodeUInt384List(vararg elements: UInt384): Bytes static fun encodeUInt384List(elements: MutableList<UInt384>): Bytes
Encode a list of UInt384. |
|
static fun encodeUInt64(value: Long): Bytes
Encode a 64-bit unsigned integer to a Bytes value. Note that |
|
static fun encodeUInt64List(vararg elements: Long): Bytes static fun encodeUInt64List(elements: MutableList<Long>): Bytes
Encode a list of 64-bit unsigned integers. Note that the |
|
static fun encodeUInt8(value: Int): Bytes
Encode an 8-bit unsigned integer to a Bytes value. |
|
static fun encodeUInt8List(vararg elements: Int): Bytes static fun encodeUInt8List(elements: MutableList<Int>): Bytes
Encode a list of 8-bit unsigned integers. |
|
static fun encodeUIntList(bitLength: Int, vararg elements: Int): Bytes static fun encodeUIntList(bitLength: Int, elements: MutableList<Int>): Bytes
Encode a list of unsigned integers. Note that the |
|
static fun encodeULong(value: Long, bitLength: Int): Bytes
Encode an unsigned long integer to a Bytes value. Note that |
|
static fun encodeULongIntList(bitLength: Int, vararg elements: Long): Bytes static fun encodeULongIntList(bitLength: Int, elements: MutableList<Long>): Bytes
Encode a list of unsigned long integers. Note that the |
|
static fun hashTreeRoot(vararg bytes: Bytes): Bytes32
Create the hash tree root of a set of values |