ChecksumManagerCore 1.0.0

dotnet add package ChecksumManagerCore --version 1.0.0                
NuGet\Install-Package ChecksumManagerCore -Version 1.0.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="ChecksumManagerCore" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ChecksumManagerCore --version 1.0.0                
#r "nuget: ChecksumManagerCore, 1.0.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.
// Install ChecksumManagerCore as a Cake Addin
#addin nuget:?package=ChecksumManagerCore&version=1.0.0

// Install ChecksumManagerCore as a Cake Tool
#tool nuget:?package=ChecksumManagerCore&version=1.0.0                

ChecksumManagerCore

To install the library from NuGet using the .NET SDK run:

paket add ChecksumManagerCore --version 1.0.0

Object Conversion

 public class TestClass
 {
    public string Name    { get; set; }
    public string Surname { get; set; }
 } 
 
 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 TestClass testClass = new TestClass()
 {
    Name    = "Hidayet Raşit",
    Surname = "ÇÖLKUŞU"
 };

 byte[] bytes = checksumCalculator.GetByteArray(testClass); 

Checksum Calculation

Object Checksum Calculation

 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 TestClass testClass = new TestClass()
 {
    Name    = "Hidayet Raşit",
    Surname = "ÇÖLKUŞU"
 };

 ushort checksum = checksumCalculator.Calculate(testClass);
 Result: 43460

Json Checksum Calculation

 ChecksumCalculator checksumCalculator = new ChecksumCalculator();
                        
 string json = @"{""Name"":""Hidayet Raşit"",""Surname"":""ÇÖLKUŞU""}";

 ushort checksum = checksumCalculator.Calculate(json);
 Result: 43460

Byte Array Checksum Calculation

 ChecksumCalculator checksumCalculator = new ChecksumCalculator();
                        
 byte[] bytes = new byte[] { 0, 1, 2, 3, 4, 0, 0 };

 ushort checksum = checksumCalculator.Calculate(bytes);
 Result: 37945

Filling

Filling Object

 public class TestClass
 {
    public string Name     { get; set; }
    public string Surname  { get; set; }
    public ushort Checksum { get; set; }
 }
 
 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 TestClass testClass = new TestClass()
 {
    Name     = "Hidayet Raşit",
    Surname  = "ÇÖLKUŞU",
    Checksum = 0
 };

 testClass = checksumCalculator.Fill(testClass); 
 Result: testClass.Checksum : 46781

Filling Json

 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 string json = @"{""Name"":""Hidayet Raşit"",""Surname"":""ÇÖLKUŞU""}";

 json = checksumCalculator.Fill(json);
 Result: {"Name":"Hidayet Raşit","Surname":"ÇÖLKUŞU","Checksum":43460}
 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 string json = @"{""Name"":""Hidayet Raşit"",""Surname"":""ÇÖLKUŞU"",""Checksum"":0}";

 json = checksumCalculator.Fill(json);
 Result: {"Name":"Hidayet Raşit","Surname":"ÇÖLKUŞU","Checksum":46781}

Filling Byte Array

 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 byte[] bytes = new byte[] { 0, 1, 2, 3, 0, 0 };

 bytes = checksumCalculator.Fill(bytes, 4);
 Result: { 0, 1, 2, 3, 204, 120 }

Comparing Checksum

Comparing Object Checksum

 public class TestClass
 {
    public string Name     { get; set; }
    public string Surname  { get; set; }
    public ushort Checksum { get; set; }
 }
 
 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 TestClass testClass = new TestClass()
 {
    Name     = "Hidayet Raşit",
    Surname  = "ÇÖLKUŞU",
    Checksum = 0
 };

 bool result = checksumCalculator.Compare(testClass, 46781);
 Result: true
 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 TestClass testClass = new TestClass()
 {
    Name     = "Hidayet Raşit",
    Surname  = "ÇÖLKUŞU",
    Checksum = 46781
 };

 bool result = checksumCalculator.Compare(testClass);
 Result: true

Comparing Json Checksum

 ChecksumCalculator checksumCalculator = new ChecksumCalculator();
             
 string json = @"{""Name"":""Hidayet Raşit"",""Surname"":""ÇÖLKUŞU""}";

 bool result = checksumCalculator.Compare(json, 43460);
 Resut:true
 ChecksumCalculator checksumCalculator = new ChecksumCalculator();
             
 string json = @"{""Name"":""Hidayet Raşit"",""Surname"":""ÇÖLKUŞU"",""Checksum"":43460}"; 

 bool result = checksumCalculator.Compare(json);
 Result:true

Comparing Byte Array Checksum

 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 byte[] bytes = new byte[] { 0, 1, 2, 3, 4, 0, 0 };

 bool result = checksumCalculator.Compare(bytes, Convert.ToUInt16(37945));
 Result:true
 ChecksumCalculator checksumCalculator = new ChecksumCalculator();

 byte[] bytes = new byte[] { 0, 1, 2, 3, 204, 120 };

 bool result = checksumCalculator.Compare(bytes, 4);
 Result:true
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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.

This package has no dependencies.

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
1.0.0 514 5/19/2020

Checksum Manager