Cbor

object Cbor

CBOR support routines.

This package includes support for CBOR as specified in RFC 8849.

Properties

Link copied to clipboard
const val BREAK: UByte

As defined in RFC 8949 3.2.1. The "break" stop code

Functions

Link copied to clipboard
fun decode(encodedCbor: ByteArray): DataItem

Decodes CBOR.

fun decode(encodedCbor: ByteArray, offset: Int): Pair<Int, DataItem>

Low-level function to decode CBOR.

Link copied to clipboard

Encodes a data item to CBOR.

Link copied to clipboard
fun toDiagnostics(encodedItem: ByteArray, options: Set<DiagnosticOption> = emptySet()): String

Returns the diagnostics notation for an encoded data item.

fun toDiagnostics(item: DataItem, options: Set<DiagnosticOption> = emptySet()): String

Returns the diagnostics notation for a data item.