---
name: "rte_hash_crc_8byte"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_hash_crc.h"
---

# rte\_hash\_crc\_8byte(3)

Part of [rte\_hash\_crc.h(3)](/rte_hash_crc.h/3.md).

## NAME

rte\_hash\_crc.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_branch_prediction.h>`\
 `#include <rte_common.h>`\
 `#include <rte_config.h>`\
 `#include 'rte_crc_sw.h'`\
 `#include 'rte_crc_generic.h'`\

### Functions

void **rte\_hash\_crc\_set\_alg** (uint8\_t alg)\
 static uint32\_t **rte\_hash\_crc\_1byte** (uint8\_t data, uint32\_t init\_val)\
 static uint32\_t **rte\_hash\_crc\_2byte** (uint16\_t data, uint32\_t init\_val)\
 static uint32\_t **rte\_hash\_crc\_4byte** (uint32\_t data, uint32\_t init\_val)\
 static uint32\_t **rte\_hash\_crc\_8byte** (uint64\_t data, uint32\_t init\_val)\
 static uint32\_t **rte\_hash\_crc** (const void \*data, uint32\_t data\_len, uint32\_t init\_val)\

## Detailed Description

RTE CRC Hash

Definition in file **rte\_hash\_crc.h**.

## Function Documentation

### void rte\_hash\_crc\_set\_alg (uint8\_t alg)

Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash calculation.

**Parameters**

*alg* An OR of following flags:

- •

  (CRC32\_SW) Don't use SSE4.2/ARMv8 intrinsics (default non-\[x86/ARMv8\])

- •

  (CRC32\_SSE42) Use SSE4.2 intrinsics if available

- •

  (CRC32\_SSE42\_x64) Use 64-bit SSE4.2 intrinsic if available (default x86)

- •

  (CRC32\_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8)

### static uint32\_t rte\_hash\_crc\_1byte (uint8\_t data, uint32\_t init\_val)` [inline]`, ` [static]`

Use single CRC32 instruction to perform a hash on a byte value.

**Parameters**

*data* Data to perform hash on. \
 *init\_val* Value to initialise hash generator.

**Returns**

32bit calculated hash value.

### static uint32\_t rte\_hash\_crc\_2byte (uint16\_t data, uint32\_t init\_val)` [inline]`, ` [static]`

Use single CRC32 instruction to perform a hash on a 2 bytes value.

**Parameters**

*data* Data to perform hash on. \
 *init\_val* Value to initialise hash generator.

**Returns**

32bit calculated hash value.

### static uint32\_t rte\_hash\_crc\_4byte (uint32\_t data, uint32\_t init\_val)` [inline]`, ` [static]`

Use single CRC32 instruction to perform a hash on a 4 bytes value.

**Parameters**

*data* Data to perform hash on. \
 *init\_val* Value to initialise hash generator.

**Returns**

32bit calculated hash value.

### static uint32\_t rte\_hash\_crc\_8byte (uint64\_t data, uint32\_t init\_val)` [inline]`, ` [static]`

Use single CRC32 instruction to perform a hash on a 8 bytes value.

**Parameters**

*data* Data to perform hash on. \
 *init\_val* Value to initialise hash generator.

**Returns**

32bit calculated hash value.

### static uint32\_t rte\_hash\_crc (const void \* data, uint32\_t data\_len, uint32\_t init\_val)` [inline]`, ` [static]`

Calculate CRC32 hash on user-supplied byte array.

**Parameters**

*data* Data to perform hash on. \
 *data\_len* How many bytes to use to calculate hash value. \
 *init\_val* Value to initialise hash generator.

**Returns**

32bit calculated hash value.

Definition at line **125** of file **rte\_hash\_crc.h**.

## Author

Generated automatically by Doxygen for DPDK from the source code.
