# xxHash3

> A feature complete hashing API based on xxHash3 (https://github.com/Cyan4973/xxHash)

## Definition

* **Type:** Class
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
[BurstCompile]
public static class xxHash3
```

## Remarks

Features:

* Compute 64bits or 128bits hash keys, based on a private key, with an optional given seed value.

* Hash on buffer (with or without a ulong based seed value)

* Hash on buffer while copying the data to a destination

* Use instances of [xxHash3.StreamingState](/engine/6000.7/script-reference/unity/collections/xxhash3/streamingstate.md) to accumulate data to hash in multiple calls, suited for small data, then retrieve the hash key at the end.

* xxHash3 has several implementation based on the size to hash to ensure best performances

* We currently have two implementations:

  * A generic one based on Unity.Mathematics, that should always be executed compiled with Burst.

  * An AVX2 based implementation for platforms supporting it, using Burst intrinsics.

* Whether or not the call site is compiled with burst, the hashing function will be executed by Burst(") to ensure optimal performance. (") Only when the hashing size justifies such transition.

## Static Methods

| Method                                                                          | Description                               |
| ------------------------------------------------------------------------------- | ----------------------------------------- |
| [Hash128](/engine/6000.7/script-reference/unity/collections/xxhash3/hash128.md) | Compute a 128bits hash of a memory region |
| [Hash64](/engine/6000.7/script-reference/unity/collections/xxhash3/hash64.md)   | Compute a 64bits hash of a memory region  |

## Structs

| Struct                                                                                                | Description                                           |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| [xxHash3.StreamingState](/engine/6000.7/script-reference/unity/collections/xxhash3/streamingstate.md) | Type used to compute hash based on multiple data feed |
