# ComputeHash128

> Compute a 128 bit hash based on a data.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.3/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## ComputeHash128(void\*, ulong, ulong\*, ulong\*)

Compute a 128 bit hash based on a data.

```csharp
public static void ComputeHash128(void* data, ulong dataSize, ulong* hash1, ulong* hash2)
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): Pointer to the data to hash.**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): The number of bytes to hash.**** (\[ulong\*]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): A pointer to store the low 64 bits of the computed hash.**** (\[ulong\*]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): A pointer to store the high 64 bits of the computed hash.

### Examples

```csharp
using UnityEngine;

public class HashUtilitiesSample
{
    public void ComputeHash128_ToULong()
    {
        unsafe
        {
            ulong* message = stackalloc ulong[2];
            message[0] = 0x73BC2A67F;
            message[1] = 0x54B1A5C2C;

            ulong h1 = 0;
            ulong h2 = 0;

            HashUnsafeUtilities.ComputeHash128(message, sizeof(ulong) * 2, &h1, &h2);
        }
    }

    public void ComputeHash128_ToHash128()
    {
        unsafe
        {
            ulong* message = stackalloc ulong[2];
            message[0] = 0x73BC2A67F;
            message[1] = 0x54B1A5C2C;

            Hash128 hash = new Hash128();

            HashUnsafeUtilities.ComputeHash128(message, sizeof(ulong) * 2, &hash);
        }
    }
}
```

## ComputeHash128(void\*, ulong, Hash128\*)

Compute a 128 bit hash based on a data.

```csharp
public static void ComputeHash128(void* data, ulong dataSize, Hash128* hash)
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): Pointer to the data to hash.**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): The number of bytes to hash.**** (\[Hash128\*]\(/engine/6000.3/script-reference/unityengine/hash128)): A pointer to the Hash128 to updated with the computed hash.

### Examples

```csharp
using UnityEngine;

public class HashUtilitiesSample
{
    public void ComputeHash128_ToULong()
    {
        unsafe
        {
            ulong* message = stackalloc ulong[2];
            message[0] = 0x73BC2A67F;
            message[1] = 0x54B1A5C2C;

            ulong h1 = 0;
            ulong h2 = 0;

            HashUnsafeUtilities.ComputeHash128(message, sizeof(ulong) * 2, &h1, &h2);
        }
    }

    public void ComputeHash128_ToHash128()
    {
        unsafe
        {
            ulong* message = stackalloc ulong[2];
            message[0] = 0x73BC2A67F;
            message[1] = 0x54B1A5C2C;

            Hash128 hash = new Hash128();

            HashUnsafeUtilities.ComputeHash128(message, sizeof(ulong) * 2, &hash);
        }
    }
}
```
