BogaNet 1.4.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BogaNet.CRC.CRC16 Class Referenceabstract

Implementation of CRC16 (ARC). NOTE: never use CRC for integrity checks, use hashes instead! More...

Static Public Member Functions

static ushort CalcCRC (params byte[] bytes)
 Calculate the CRC16 (ARC) for a byte-array.
 
static ushort CalcCRC (string text, Encoding? encoding=null)
 Calculate CRC16 (ARC) for a string.
 
static ushort CalcCRCFile (string file)
 Calculate the CRC16 for a file.
 
static async Task< ushort > CalcCRCFileAsync (string file)
 /// Calculate the CRC16 for a file asynchronously.
 

Detailed Description

Implementation of CRC16 (ARC). NOTE: never use CRC for integrity checks, use hashes instead!

Member Function Documentation

◆ CalcCRC() [1/2]

static ushort BogaNet.CRC.CRC16.CalcCRC ( params byte[] bytes)
static

Calculate the CRC16 (ARC) for a byte-array.

Parameters
bytesBytes for the CRC16
Returns
CRC16 as ushort
Exceptions
ArgumentNullException

◆ CalcCRC() [2/2]

static ushort BogaNet.CRC.CRC16.CalcCRC ( string text,
Encoding? encoding = null )
static

Calculate CRC16 (ARC) for a string.

Parameters
textstring for the CRC16
encodingEncoding of the string (optional, default: UTF8)
Returns
CRC16 as ushort
Exceptions
ArgumentNullException

◆ CalcCRCFile()

static ushort BogaNet.CRC.CRC16.CalcCRCFile ( string file)
static

Calculate the CRC16 for a file.

Parameters
fileFile to crc
Returns
CRC16 as ushort
Exceptions
Exception

◆ CalcCRCFileAsync()

static async Task< ushort > BogaNet.CRC.CRC16.CalcCRCFileAsync ( string file)
static

/// Calculate the CRC16 for a file asynchronously.

Parameters
fileFile to crc
Returns
CRC16 as ushort
Exceptions
Exception

The documentation for this class was generated from the following file: