Loading...
Searching...
No Matches
crc16.h File Reference

CRC-16 utility functions. More...

Macros

#define SPDK_T10DIF_CRC16_POLYNOMIAL   0x8bb7u
 T10-DIF CRC-16 polynomial.
 

Functions

uint16_t spdk_crc16_t10dif (uint16_t init_crc, const void *buf, size_t len)
 Calculate T10-DIF CRC-16 checksum.
 
uint16_t spdk_crc16_t10dif_copy (uint16_t init_crc, uint8_t *dst, uint8_t *src, size_t len)
 Calculate T10-DIF CRC-16 checksum and copy data.
 

Detailed Description

CRC-16 utility functions.

Function Documentation

◆ spdk_crc16_t10dif()

uint16_t spdk_crc16_t10dif ( uint16_t init_crc,
const void * buf,
size_t len )

Calculate T10-DIF CRC-16 checksum.

Parameters
init_crcInitial CRC-16 value.
bufData buffer to checksum.
lenLength of buf in bytes.
Returns
CRC-16 value.

◆ spdk_crc16_t10dif_copy()

uint16_t spdk_crc16_t10dif_copy ( uint16_t init_crc,
uint8_t * dst,
uint8_t * src,
size_t len )

Calculate T10-DIF CRC-16 checksum and copy data.

Parameters
init_crcInitial CRC-16 value.
dstDestination data buffer for copy.
srcSource data buffer for CRC calculation and copy.
lenLength of buffer in bytes.
Returns
CRC-16 value.