---
name: "SDL_crc16"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_crc16"
---

# SDL\_crc16(3)

Calculate a CRC-16 value.

## NAME

SDL\_crc16 - Calculate a CRC-16 value.

## HEADER FILE

Defined in SDL3/SDL\_stdinc.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**Uint16 SDL\_crc16(Uint16 crc, const void \*data, size\_t len);**

## 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.

## RETURN VALUE

( **Uint16** ) Returns a CRC-16 checksum value of all blocks in the data set.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.
