|
3rd Eye Scene C#
3rd Eye Scene C# documentation
|
This class is used to calculate a 2-byte/16-bit CRC value for a memory buffer. More...
Public Member Functions | |
| Crc16 () | |
| Creates a CRC calculator. | |
| Crc16 (ushort initial, ushort final, ushort polynomial) | |
| Creates a CRC calculator with the given CRC seed values. | |
| ushort | Calculate (byte[] buffer) |
| Calculate a CRC for the given buffer. | |
| ushort | Calculate (byte[] buffer, uint bufferLength) |
| Calculate a CRC for part of the given buffer (from the start). | |
| ushort | Calculate (byte[] buffer, uint startIndex, uint numberOfBytes) |
| Calculate a CRC for part of the given buffer. | |
Properties | |
| static Crc16 | Crc [get] |
| Access the default calculator. | |
| static int | CrcSize [get] |
| The size of the calculated CRC in bytes. | |
This class is used to calculate a 2-byte/16-bit CRC value for a memory buffer.
General usage is to use the Crc static property to access the default calculator (see below).
ushort calcCrc(byte[] buffer)
{
return Crc16.Crc.Calculate(buffer);
}
| Tes::IO::Crc16::Crc16 | ( | ushort | initial, |
| ushort | final, | ||
| ushort | polynomial | ||
| ) | [inline] |
Creates a CRC calculator with the given CRC seed values.
| initial | The initial CRC starting value. |
| final | The final XOR value applied to the CRC. |
| polynomial | The polynomial use dto initialise the CRC table. |
| ushort Tes::IO::Crc16::Calculate | ( | byte[] | buffer | ) | [inline] |
Calculate a CRC for the given buffer.
| buffer | The buffer to operate on. |
| ushort Tes::IO::Crc16::Calculate | ( | byte[] | buffer, |
| uint | startIndex, | ||
| uint | numberOfBytes | ||
| ) | [inline] |
Calculate a CRC for part of the given buffer.
The startIndex must be in range of the buffer . The sum of the startIndex and the numberOfBytes must be less than or equal to buffer.Length.
| buffer | The buffer to operate on. |
| startIndex | CRC calculation starts at this byte into the buffer . |
| numberOfBytes | The number of bytes to calculate the CRC for. |
| ushort Tes::IO::Crc16::Calculate | ( | byte[] | buffer, |
| uint | bufferLength | ||
| ) | [inline] |
Calculate a CRC for part of the given buffer (from the start).
| buffer | The buffer to operate on. |
| bufferLength | The number of bytes to calculate the CRC for. Must be less than buffer.Length |