logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_crc16 - Calculate a CRC-16 value.

Availability

       This function is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.20                                       SDL_crc16(3)

Description

       https://en.wikipedia.org/wiki/Cyclic_redundancy_check

       This  function  can  be called multiple times, to stream data to be checksummed in blocks. Each call must
       provide the previous CRC-16 return value to be updated with the  next  block.  The  first  call  to  this
       function for a set of blocks should pass in a zero CRC value.

Function Parameters

crc    the current checksum for this data set, or 0 for a new data set.

       data   a new block of data to add to the checksum.

       len    the size, in bytes, of the new block of data.

Name

       SDL_crc16 - Calculate a CRC-16 value.

Return Value

       Returns a CRC-16 checksum value of all blocks in the data set.

Synopsis

#include<SDL3/SDL_stdinc.h>Uint16SDL_crc16(Uint16crc,constvoid*data,size_tlen);

Thread Safety

       It is safe to call this function from any thread.

See Also