---
title: hash
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nshashtablecallbacks/hash
---

# hash

Points to the function that must produce hash code for elements of the hash table. If NULL, the pointer value is used as the hash code. Second parameter is the element for which hash code should be produced.

## Declaration

```swift
var hash: ((NSHashTable<AnyObject>, UnsafeRawPointer) -> Int)?
```
