Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

nim-cbor-serialization is a library in the nim-serialization family for turning Nim objects into CBOR and back. Features include:

  • Efficient coding of CBOR directly to and from Nim data types
    • Full type-based customization of both encoding and decoding
    • Flavors for defining multiple CBOR serialization styles per Nim type
    • Efficient skipping of data items for partial CBOR parsing
  • Flexibility in mixing type-based and dynamic CBOR access
    • Structured CborValueRef node type for DOM-style access to parsed data
    • Flat CborBytes type for passing nested CBOR data between abstraction layers
  • RFC8949 spec compliance
    • Passes CBORTestVectors
    • Customizable parser strictness including support for non-standard extensions
  • Well-defined handling of malformed / malicious inputs with configurable parsing limits

Installation

As a nimble dependency:

requires "cbor_serialization"

Via nimble install:

nimble install cbor_serialization

API documentation

This guide covers basic usage of cbor_serialization - for details, see the API reference.