org.sigilaris.core.codec.byte

Members list

Type members

Classlikes

trait ByteCodec[A] extends ByteDecoder[A], ByteEncoder[A]

Bidirectional byte codec combining encoder and decoder.

Bidirectional byte codec combining encoder and decoder.

ByteCodec extends both ByteEncoder and ByteDecoder, providing a single type class for types that support both encoding and decoding.

Most types have both encoder and decoder instances, so ByteCodec is automatically derived when both are available.

Attributes

See also

ByteEncoder for encoding operations

ByteDecoder for decoding operations

types.md for encoding/decoding rules per type

Companion
object
Source
ByteCodec.scala
Supertypes
trait ByteEncoder[A]
trait ByteDecoder[A]
class Object
trait Matchable
class Any
Known subtypes
trait OrderedCodec[A]
Self type
object ByteCodec

Attributes

Companion
trait
Source
ByteCodec.scala
Supertypes
class Object
trait Matchable
class Any
Self type
ByteCodec.type
trait ByteDecoder[A]

Type class for decoding byte sequences to Scala values.

Type class for decoding byte sequences to Scala values.

ByteDecoder is the inverse of ByteEncoder, reconstructing typed values from deterministic byte representations.

Decoding returns Either[DecodeFailure, DecodeResult[A]]:

  • Left(failure): decoding failed with error message
  • Right(result): successfully decoded value with remaining bytes

The remainder allows sequential decoding of multiple values from a single byte sequence.

Attributes

See also

ByteEncoder for the encoding operation

ByteCodec for bidirectional encoding/decoding

types.md for detailed decoding rules per type

Companion
object
Source
ByteDecoder.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ByteDecoder

Attributes

Companion
trait
Source
ByteDecoder.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait ByteEncoder[A]

Type class for encoding Scala values to deterministic byte sequences.

Type class for encoding Scala values to deterministic byte sequences.

ByteEncoder provides type-safe encoding of Scala data structures into ByteVector representations suitable for blockchain applications such as transaction signing, block hashing, and merkle tree construction.

The encoding is deterministic: the same value always produces the same byte sequence, ensuring consistency across different platforms and nodes.

Attributes

See also

ByteDecoder for the inverse operation

ByteCodec for bidirectional encoding/decoding

types.md for detailed encoding rules per type

Companion
object
Source
ByteEncoder.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ByteEncoder

Attributes

Companion
trait
Source
ByteEncoder.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final case class DecodeResult[A](value: A, remainder: ByteVector)

Result of a decoding operation.

Result of a decoding operation.

Value parameters

remainder

remaining bytes after decoding

value

the decoded value

Attributes

Source
ByteDecoder.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all