# Hash(void*, int)

> Returns a (non-cryptographic) hash of a memory block.

## Definition

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

```csharp
public static uint Hash(void* ptr, int bytes)
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): A buffer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of bytes to hash.

### Returns

| Type                                                         | Description          |
| ------------------------------------------------------------ | -------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | A hash of the bytes. |

### Remarks

The hash function used is \<a href="[http://web.archive.org/web/20190508211657/http://www.cse.yorku.ca/\~oz/hash.html"\&gt;djb2\&lt;/a](http://web.archive.org/web/20190508211657/http://www.cse.yorku.ca/~oz/hash.html"\&gt;djb2\&lt;/a)>.
