Skip to content

Repository files navigation

Serde.Cbor

A CBOR (Concise Binary Object Representation, RFC 8949) serializer and deserializer for .NET, built on the Serde serialization framework.

Serde.Cbor is an extremely fast, AOT-compatible serializer/deserializer library for .NET 10+ with a simple declaritive attribute-based model.

Installation

dotnet add package Serde.Cbor

Usage

Use the [GenerateSerde] attribute from the Serde framework to generate serialization code for your types:

using Serde;
using Serde.Cbor;

[GenerateSerde]
public partial record Person
{
    public required string Name { get; init; }
    public int Age { get; init; }
}

var person = new Person { Name = "Alice", Age = 30 };
byte[] bytes = CborSerializer.Serialize(person);
Person deserialized = CborSerializer.Deserialize<Person>(bytes);

Related projects

  • Serde — the underlying serialization framework

License

BSD-3-Clause. See LICENSE for details.

About

CBOR backend for Serde

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages