VarUInt

scalus.cardano.address.VarUInt
object VarUInt

Implementation of Cardano CIP-19 address format following Rust Pallas implementation structure. Handles the binary structure of Cardano addresses including Shelley, Stake, and Byron addresses. Uses strongly typed Hash28 classes for payment, stake and script hashes.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
VarUInt.type

Members list

Value members

Concrete methods

def decodeVariableLengthUInt(bytes: Array[Byte], startIndex: Int): (Long, Int)

Decode variable-length integer as specified in CIP-19 Handles continuation bit protocol to reconstruct original value

Decode variable-length integer as specified in CIP-19 Handles continuation bit protocol to reconstruct original value

Value parameters

bytes

Source byte array

startIndex

Index to start decoding from

Attributes

Returns

Tuple of (decoded value, number of bytes consumed)

def encodeVariableLengthUInt(value: Long): Array[Byte]

Encode positive integer using variable-length encoding as specified in CIP-19 Uses continuation bits to handle arbitrarily large values efficiently

Encode positive integer using variable-length encoding as specified in CIP-19 Uses continuation bits to handle arbitrarily large values efficiently

Value parameters

value

The positive integer to encode (must be >= 0)

Attributes

Returns

Encoded bytes with continuation bit protocol