1-Wire API for Compact.NET  Version 4.10
CRC16 Class Reference

CRC16 is a class containing an implementation of the Cyclic-Redundency-Check (CRC) CRC16. More...

Static Public Member Functions

static uint Compute (uint dataToCrc)
 Perform the CRC16 on the data element based on a zero seed. More...
 
static uint Compute (uint dataToCrc, uint seed)
 Perform the CRC16 on the data element based on the provided seed. More...
 
static uint Compute (byte[] dataToCrc)
 Perform the CRC16 on an array of data elements based on a zero seed. More...
 
static uint Compute (byte[] dataToCrc, int off, int len)
 Perform the CRC16 on an array of data elements based on a zero seed. More...
 
static uint Compute (byte[] dataToCrc, int off, int len, uint seed)
 Perform the CRC16 on an array of data elements based on the provided seed. More...
 
static uint Compute (byte[] dataToCrc, uint seed)
 Perform the CRC16 on an array of data elements based on the provided seed. More...
 
static uint Compute (string dataToCrc, uint seed)
 Perform the CRC16 on an array of data elements based on the provided seed. More...
 

Detailed Description

CRC16 is a class containing an implementation of the Cyclic-Redundency-Check (CRC) CRC16.

The CRC16 is used in iButton memory packet structure.

CRC16 is based on the polynomial = X^16 + X^15 + X^2 + 1.

<version> 0.00, 28 Aug 2000 </version> <author> DS </author>

Member Function Documentation

◆ Compute() [1/7]

static uint Compute ( uint  dataToCrc)
static

Perform the CRC16 on the data element based on a zero seed.

CRC16 is based on the polynomial = X^16 + X^15 + X^2 + 1.

Parameters
dataToCrcdata element on which to perform the CRC16
Returns
CRC16 value

◆ Compute() [2/7]

static uint Compute ( uint  dataToCrc,
uint  seed 
)
static

Perform the CRC16 on the data element based on the provided seed.

CRC16 is based on the polynomial = X^16 + X^15 + X^2 + 1.

Parameters
dataToCrcdata element on which to perform the CRC16
Returns
CRC16 value

◆ Compute() [3/7]

static uint Compute ( byte []  dataToCrc)
static

Perform the CRC16 on an array of data elements based on a zero seed.

CRC16 is based on the polynomial = X^16 + X^15 + X^2 + 1.

Parameters
dataToCrcarray of data elements on which to perform the CRC16
Returns
CRC16 value

◆ Compute() [4/7]

static uint Compute ( byte []  dataToCrc,
int  off,
int  len 
)
static

Perform the CRC16 on an array of data elements based on a zero seed.

CRC16 is based on the polynomial = X^16 + X^15 + X^2 + 1.

Parameters
dataToCrcarray of data elements on which to perform the CRC16
offoffset into the data array
lenlength of data to CRC16
Returns
CRC16 value

◆ Compute() [5/7]

static uint Compute ( byte []  dataToCrc,
int  off,
int  len,
uint  seed 
)
static

Perform the CRC16 on an array of data elements based on the provided seed.

CRC16 is based on the polynomial = X^16 + X^15 + X^2 + 1.

Parameters
dataToCrcarray of data elements on which to perform the CRC16
offoffset into the data array
lenlength of data to CRC16
seedseed to use for CRC16
Returns
CRC16 value

◆ Compute() [6/7]

static uint Compute ( byte []  dataToCrc,
uint  seed 
)
static

Perform the CRC16 on an array of data elements based on the provided seed.

CRC16 is based on the polynomial = X^16 + X^15 + X^2 + 1.

Parameters
dataToCrcarray of data elements on which to perform the CRC16
seedseed to use for CRC16
Returns
CRC16 value

◆ Compute() [7/7]

static uint Compute ( string  dataToCrc,
uint  seed 
)
static

Perform the CRC16 on an array of data elements based on the provided seed.

CRC16 is based on the polynomial = X^16 + X^15 + X^2 + 1.

Parameters
dataToCrcarray of data elements on which to perform the CRC16
seedseed to use for CRC16
Returns
CRC16 value

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