MackySoft.Json.Canonicalization 0.1.0

dotnet add package MackySoft.Json.Canonicalization --version 0.1.0
                    
NuGet\Install-Package MackySoft.Json.Canonicalization -Version 0.1.0
                    
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="MackySoft.Json.Canonicalization" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MackySoft.Json.Canonicalization" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MackySoft.Json.Canonicalization" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MackySoft.Json.Canonicalization --version 0.1.0
                    
#r "nuget: MackySoft.Json.Canonicalization, 0.1.0"
                    
#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.
#:package MackySoft.Json.Canonicalization@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MackySoft.Json.Canonicalization&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MackySoft.Json.Canonicalization&version=0.1.0
                    
Install as a Cake Tool

MackySoft.Json.Canonicalization

MackySoft.Json.Canonicalization provides product-independent RFC 8785 JSON canonicalization for .NET. It targets netstandard2.1.

The package accepts UTF-8 JSON or System.Text.Json.JsonElement values through Rfc8785JsonCanonicalizer and returns an owned canonical UTF-8 byte array. Consumers pass those bytes to the digest algorithm or comparison mechanism required by their own contracts. General hashing, JSON Schema generation, product-specific semantic validation, and artifact storage are outside this package.

Input and output contract

The raw UTF-8 entry point accepts one JSON value without a UTF-8 byte-order mark. It rejects invalid UTF-8, comments, trailing commas, additional top-level values, duplicate decoded property names, unpaired UTF-16 surrogates, and numbers outside the finite IEEE 754 binary64 domain. It also rejects negative zero in accordance with verified RFC 8785 erratum 7920.

JSON number tokens are interpreted as binary64 values before ECMAScript number serialization. Distinct decimal tokens that round to the same binary64 value therefore produce the same canonical bytes.

Raw input has a maximum nesting depth of 64. The package does not impose a byte-size limit; transports and file readers must apply their own limit before canonicalization. The JsonElement entry point operates on the already parsed JSON value, so syntax and parser-depth policy remain the responsibility of the parser that created the element.

Every successful call returns a newly allocated byte[]. The caller owns that array, and its lifetime is independent of the input buffer or source JsonDocument.

Contract violations throw JsonCanonicalizationException. Its FailureKind is one of these CLR enum members:

  • InvalidJson
  • DuplicateProperty
  • InvalidUnicode
  • NumberNotRepresentable
  • NegativeZero
  • MaximumDepthExceeded

These enum member names classify failures inside .NET. This package does not define a serialized text token or JSON converter for them.

Embedded number serialization

ECMAScript-compatible number serialization is built from the C# source in the RFC 8785 authors' official cyberphone/json-canonicalization repository at pinned commit 19d51d7fe467d4706a3ff08adf8a748f29fc21e0. The implementation is embedded as an internal detail and does not add another public API or NuGet dependency.

The copied source retains its original headers. The package includes THIRD-PARTY-NOTICES.md, the Apache License 2.0, and the Mozilla Public License 2.0 that apply to the upstream contributions.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on MackySoft.Json.Canonicalization:

Package Downloads
MackySoft.JsonSchema.Generation

Product-independent JSON Contract Model, JSON Schema Draft 2020-12, and type metadata generation for .NET.

MackySoft.Ucli.Contracts

Shared contract types for uCLI IPC protocol.

MackySoft.Ucli.Unity

Unity Editor plugin for uCLI IPC and automation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 4,055 7/24/2026