Install-Package cs-varint -Version 1.0.0
dotnet add package cs-varint --version 1.0.0
<PackageReference Include="cs-varint" Version="1.0.0" />
paket add cs-varint --version 1.0.0
#r "nuget: cs-varint, 1.0.0"
// Install cs-varint as a Cake Addin #addin nuget:?package=cs-varint&version=1.0.0 // Install cs-varint as a Cake Tool #tool nuget:?package=cs-varint&version=1.0.0
This is a C# .NET Core port of the repository https://github.com/multiformats/go-varint
Varint helpers that enforce minimal encoding.
The purpose of this port is to support future efforts to port go-libp2p to the C# language.
This is a C# class library. You may include it in any project by referencing using the dotnet CLI too, such as:
dotnet add reference ./VarInt/VarInt.csproj
Or simply by using the NuGet package manager, like:
dotnet add package cs-varint
To convert to or from variable binary encoded UInt64 values, use the VarInt static class methods.
var into = VarInt.ToUVarInt(i); var back = VarInt.FromUVarInt(into);
This is a library that is to be used by a project which includes it.
Method signatures are generally preserved as-is from the source library go-varint, with these notable deviations:
- Uvarint is renamed UVarInt to match .NET standard naming conventions, such as seeen in BigInt
- Errors are not returned as objects in a tuple; they are thrown as C# exceptions, so callers will need to use try/catch (common in .NET) instead of return value checking (common in Go)
Small note: If editing the Readme, please conform to the standard-readme specification.
- No dependencies.
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.