CommonCodecs

class Object
trait Matchable
class Any

Value members

Concrete methods

def base32(size: Int): Codec[String]
def discriminatorWithDefault[A](discriminator: Codec[A], fallback: Codec[A]): Codec[A]
def lengthDelimited[T](codec: Codec[T]): Codec[T]

All LN protocol message must be stored as length-delimited, because they may have arbitrary trailing data

All LN protocol message must be stored as length-delimited, because they may have arbitrary trailing data

Source:
CommonCodecs.scala
def mapCodec[K, V](keyCodec: Codec[K], valueCodec: Codec[V]): Codec[Map[K, V]]
def minimalvalue[A : Ordering](codec: Codec[A], min: A): Codec[A]

We impose a minimal encoding on some values (such as varint and truncated int) to ensure that signed hashes can be re-computed correctly. If a value could be encoded with less bytes, it's considered invalid and results in a failed decoding attempt.

We impose a minimal encoding on some values (such as varint and truncated int) to ensure that signed hashes can be re-computed correctly. If a value could be encoded with less bytes, it's considered invalid and results in a failed decoding attempt.

Value parameters:
codec

the value codec (depends on the value).

min

the minimal value that should be encoded.

Source:
CommonCodecs.scala
def prependmac[A](codec: Codec[A], macKey: ByteVector): Codec[A]

When encoding, prepend a valid mac to the output of the given codec. When decoding, verify that a valid mac is prepended.

When encoding, prepend a valid mac to the output of the given codec. When decoding, verify that a valid mac is prepended.

Source:
CommonCodecs.scala
def setCodec[T](codec: Codec[T]): Codec[Set[T]]
def zeropaddedstring(size: Int): Codec[String]

Concrete fields

val bool8: Codec[Boolean]

byte-aligned boolean codec

byte-aligned boolean codec

Source:
CommonCodecs.scala