CommonCodecs

class Object
trait Matchable
class Any

Value members

Concrete methods

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 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

Concrete fields

byte-aligned boolean codec

byte-aligned boolean codec

Source:
CommonCodecs.scala
val ipv4address: Codec[Inet4Address]
val ipv6address: Codec[Inet6Address]