Hexarc.Borsh 0.0.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Hexarc.Borsh --version 0.0.10
NuGet\Install-Package Hexarc.Borsh -Version 0.0.10
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hexarc.Borsh" Version="0.0.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hexarc.Borsh --version 0.0.10
#r "nuget: Hexarc.Borsh, 0.0.10"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Hexarc.Borsh as a Cake Addin
#addin nuget:?package=Hexarc.Borsh&version=0.0.10

// Install Hexarc.Borsh as a Cake Tool
#tool nuget:?package=Hexarc.Borsh&version=0.0.10

Hexarc Borsh

License NuGet Downloads

Hexarc.Borsh is .NET implementation of the Binary Object Representation Serializer for Hashing format.

Current status: 🚧 Under development 🚧

Getting started

Install the package with the NuGet CLI:

dotnet add package Hexarc.Borsh

Reference the Hexarc.Borsh namespace in your code:

using Hexarc.Borsh;

Serialize and deserialize .NET objects via the BorshSerializer class:

public class Point
{
    public Int32 X { get; init; }
    public Int32 Y { get; init; }
    public Int32 Z { get; init; }
}

var point = new Point() { X = 5, Y = 10, Z = 20 };

var raw = BorshSerializer.Serialize(point);
var restored = BorshSerializer.Deserialize(raw);

Features

Limited count of the .NET types are currently supported:

  • Byte, SByte, Boolean, Int16, UInt16, Int32, UInt32, Int64, UInt64
  • Single, Double
  • Nullable<T>
  • Enum
  • String
  • Arrays as T[]
  • HashSet<T>
  • Hexarc.Borsh.Option<T>
  • POCO like user defined classes

All other types are not supported at the moment but already planned.

Another important notice that Borsh is mostly designed to support the Rust type system. So null reference values are not supported in .NET implementation. Please use the special Hexarc.Borsh.Option<T> type instead of .NET nullable reference types: So this example:

public class PersonDetails
{
    public String? FirstName { get; init; }
    public String? LastName { get; init; }
}

should be rewritten as:

public class PersonDetails
{
    public Option<String> FirstName { get; init; }
    public Option<String> LastName { get; init; }
}

Acknowledgments

Built with JetBrains tools for Open Source projects.

JetBrains Logo (Main) logo

License

MIT © Max Koverdyaev

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 792 12/4/2022
2.0.1 334 11/18/2022
2.0.0 351 11/12/2022
1.3.1 63,988 8/31/2022
1.3.0 7,440 8/29/2022
1.2.2 384 8/28/2022
1.2.1 389 8/28/2022
1.2.0 391 8/26/2022
1.1.2 417 8/6/2022
1.1.1 3,696 7/15/2022
1.1.0 430 7/15/2022
1.0.0 5,745 2/26/2022
0.6.0 441 2/25/2022
0.5.0 440 2/24/2022
0.4.0 455 2/23/2022
0.3.0 432 2/22/2022
0.2.0 423 2/21/2022
0.1.0 421 2/20/2022
0.0.15 432 2/19/2022
0.0.14 437 2/18/2022
0.0.13 446 2/18/2022
0.0.12 438 2/17/2022
0.0.11 418 2/17/2022
0.0.10 398 2/16/2022
0.0.9 417 2/16/2022
0.0.8 411 2/16/2022
0.0.7 408 2/16/2022
0.0.6 431 2/16/2022
0.0.5 435 2/14/2022
0.0.4 409 2/10/2022
0.0.3 412 2/10/2022
0.0.2 426 2/9/2022
0.0.1 428 2/6/2022