Honoo.IO.Hashing.Crc 1.0.16

There is a newer version of this package available.
See the version list below for details.
dotnet add package Honoo.IO.Hashing.Crc --version 1.0.16                
NuGet\Install-Package Honoo.IO.Hashing.Crc -Version 1.0.16                
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="Honoo.IO.Hashing.Crc" Version="1.0.16" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Honoo.IO.Hashing.Crc --version 1.0.16                
#r "nuget: Honoo.IO.Hashing.Crc, 1.0.16"                
#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 Honoo.IO.Hashing.Crc as a Cake Addin
#addin nuget:?package=Honoo.IO.Hashing.Crc&version=1.0.16

// Install Honoo.IO.Hashing.Crc as a Cake Tool
#tool nuget:?package=Honoo.IO.Hashing.Crc&version=1.0.16                

Honoo.IO.Hashing.Crc

INTRODUCTION

CRC implemenations.

CRC name of catalogue(112) are supported.

Custom width and parameters are supported.

Catalogue of parametrised CRC algorithms: https://reveng.sourceforge.io/crc-catalogue/all.htm .

Catalogue of supported CRC algorithms:

CRC-3/GSM, CRC-3/ROHC, CRC-4/G-704, CRC-4/ITU, CRC-4/INTERLAKEN, CRC-5/EPC-C1G2, CRC-5/EPC, CRC-5/G-704, CRC-5/ITU, CRC-5/USB, CRC-6/CDMA2000-A, CRC-6/CDMA2000-B, CRC-6/DARC, CRC-6/G-704, CRC-6/ITU, CRC-6/GSM, CRC-7/MMC, CRC-7, CRC-7/ROHC, CRC-7/UMTS, CRC-8/AUTOSAR, CRC-8/BLUETOOTH, CRC-8/CDMA2000, CRC-8/DARC, CRC-8/DVB-S2, CRC-8/GSM-A, CRC-8/GSM-B, CRC-8/HITAG, CRC-8/I-432-1, CRC-8/ITU, CRC-8/I-CODE, CRC-8/LTE, CRC-8/MAXIM-DOW, CRC-8/MAXIM, DOW-CRC, CRC-8/MIFARE-MAD, CRC-8/NRSC-5, CRC-8/OPENSAFETY, CRC-8/ROHC, CRC-8/SAE-J1850, CRC-8/SMBUS, CRC-8, CRC-8/TECH-3250, CRC-8/AES, CRC-8/EBU, CRC-8/WCDMA, CRC-10/ATM, CRC-10, CRC-10/I-610, CRC-10/CDMA2000, CRC-10/GSM, CRC-11/FLEXRAY, CRC-11, CRC-11/UMTS, CRC-12/CDMA2000, CRC-12/DECT, X-CRC-12, CRC-12/GSM, CRC-12/UMTS, CRC-12/3GPP, CRC-13/BBC, CRC-14/DARC, CRC-14/GSM, CRC-15/CAN, CRC-15, CRC-15/MPT1327, CRC-16/ARC, ARC, CRC-16, CRC-16/LHA, CRC-IBM, CRC-16/CDMA2000, CRC-16/CMS, CRC-16/DDS-110, CRC-16/DECT-R, R-CRC-16, CRC-16/DECT-X, X-CRC-16, CRC-16/DNP, CRC-16/EN-13757, CRC-16/GENIBUS, CRC-16/DARC, CRC-16/EPC, CRC-16/EPC-C1G2, CRC-16/I-CODE, CRC-16/GSM, CRC-16/IBM-3740, CRC-16/AUTOSAR, CRC-16/CCITT-FALSE, CRC-16/IBM-SDLC, CRC-16/ISO-HDLC, CRC-16/ISO-IEC-14443-3-B, CRC-16/X-25, CRC-B, X-25, CRC-16/ISO-IEC-14443-3-A, CRC-A, CRC-16/KERMIT, CRC-16/BLUETOOTH, CRC-16/CCITT, CRC-16/CCITT-TRUE, CRC-16/V-41-LSB, CRC-CCITT, KERMIT, CRC-16/LJ1200, CRC-16/M17, CRC-16/MAXIM-DOW, CRC-16/MAXIM, CRC-16/MCRF4XX, CRC-16/MODBUS, MODBUS, CRC-16/NRSC-5, CRC-16/OPENSAFETY-A, CRC-16/OPENSAFETY-B, CRC-16/PROFIBUS, CRC-16/IEC-61158-2, CRC-16/RIELLO, CRC-16/SPI-FUJITSU, CRC-16/AUG-CCITT, CRC-16/T10-DIF, CRC-16/TELEDISK, CRC-16/TMS37157, CRC-16/UMTS, CRC-16/BUYPASS, CRC-16/VERIFONE, CRC-16/USB, CRC-16/XMODEM, CRC-16/ACORN, CRC-16/LTE, CRC-16/V-41-MSB, XMODEM, ZMODEM, CRC-17/CAN-FD, CRC-21/CAN-FD, CRC-24/BLE, CRC-24/FLEXRAY-A, CRC-24/FLEXRAY-B, CRC-24/INTERLAKEN, CRC-24/LTE-A, CRC-24/LTE-B, CRC-24/OPENPGP, CRC-24, CRC-24/OS-9, CRC-30/CDMA, CRC-31/PHILIPS, CRC-32/AIXM, CRC-32Q, CRC-32/AUTOSAR, CRC-32/BASE91-D, CRC-32D, CRC-32/BZIP2, CRC-32/AAL5, CRC-32/DECT-B, B-CRC-32, CRC-32/CD-ROM-EDC, CRC-32/CKSUM, CKSUM, CRC-32/POSIX, CRC-32/ISCSI, CRC-32/BASE91-C, CRC-32/CASTAGNOLI, CRC-32/INTERLAKEN, CRC-32C, CRC-32/ISO-HDLC, CRC-32, CRC-32/ADCCP, CRC-32/V-42, CRC-32/XZ, PKZIP, CRC-32/JAMCRC, JAMCRC, CRC-32/MEF, CRC-32/MPEG-2, CRC-32/XFER, XFER, CRC-40/GSM, CRC-64/ECMA-182, CRC-64, CRC-64/GO-ISO, CRC-64/MS, CRC-64/REDIS, CRC-64/WE, CRC-64/XZ, CRC-64/GO-ECMA, CRC-82/DARC,

GUIDE

GitHub

https://github.com/LokiHonoo/Honoo.IO.Hashing.Crc

USAGE


using Honoo.IO.Hashing;


private static void Demo1()
{
    var crc = Crc.Create("crc32");
    // Update input data.
    crc.Update(inputBytes);
    // The return value is "Hex String".
    string checksum = crc.ComputeFinal(NumericsStringFormat.Hex);
}

private static void Demo2()
{
    var crc = new Crc16Modbus();
    crc.Update(inputBytes);
    // The return value length is crc.ChecksumLength.
    byte[] checksum = crc.ComputeFinal(Endian.BigEndian);
}

private static void Demo3()
{
    var crc = Crc.Create(CrcName.CRC40_GSM);
    crc.Update(inputBytes);
    // Width is 40 bits, ulong is 64 bits, The truncated is "False".
    bool truncated = crc.ComputeFinal(out ulong checksum);
    crc.Update(inputBytes);
    // Width is 40 bits, uint is 32 bits, The truncated is "True".
    bool truncated = crc.ComputeFinal(out uint checksum);
}

private static void Demo4()
{
    // Custom lengths and parameters are supported.
    var crc = Crc.Create("CRC-217/CUSTOM", 217, true, true, "polyHex", "initHex", "xoroutHex");
    crc.Update(inputBytes);
    byte[] checksum = new byte[crc.ChecksumLength];
    int length = crc.ComputeFinal(Endian.BigEndian, checksum, 0);
}

SPEED

Byte length - 8192

algorithm core table times elapsed
CRC-32 32 bits table 10000 329 ms
CRC-32 32 bits 10000 3182 ms
CRC-32 sharding 8 bits table 10000 1081 ms
CRC-32 sharding 8 bits 10000 9702 ms
CRC-32 sharding 32 bits table 10000 673 ms
CRC-32 sharding 32 bits 10000 6164 ms
CRC-64/REDIS 64 bits table 10000 312 ms
CRC-64/REDIS sharding 32 bits table 10000 790 ms
CRC-217/CUSTOM sharding 32 bits table 10000 1405 ms
CRC32 system table 10000 196 ms
CRC64 system table 10000 176 ms
SHA1 system 10000 120 ms
SHA256 system 10000 41 ms

LICENSE

MIT license.

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 net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 is compatible.  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.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETStandard 2.0

    • 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.1.3 102 9/26/2024
1.0.16 463 9/20/2024
1.0.14 1,404 7/13/2024
1.0.12 129 7/7/2024
1.0.10 292 6/1/2024
1.0.8 12,536 9/16/2023