ssz / org.apache.tuweni.ssz / SSZ / encodeInt

encodeInt

static fun encodeInt(value: Int, bitLength: Int): Bytes (source)

Encode a two's-compliment integer to a Bytes value.

Parameters

value - the integer to encode

bitLength - the bit length of the encoded integer value (must be a multiple of 8)

Exceptions

IllegalArgumentException - if the value is too large for the specified bitLength

Return
the SSZ encoding in a Bytes value