---
title: "xpc_hash(_:)"
framework: xpc
role: symbol
role_heading: Function
path: "xpc/xpc_hash(_:)"
---

# xpc_hash(_:)

Calculates a hash value for the specified object.

## Declaration

```swift
func xpc_hash(_ object: xpc_object_t) -> Int
```

## Parameters

- `object`: The object for which to calculate a hash value. This value may be modded with a table size for insertion into a dictionary-like data structure.

## Return Value

Return Value The calculated hash value.

## Discussion

Discussion Note that the computed hash values for any particular type and value of an object can change from across releases and platforms and should not be assumed to be constant across all time and space or stored persistently.

## See Also

### Identity

- [xpc_get_type(_:)](xpc/xpc_get_type(_:).md)
- [xpc_type_get_name(_:)](xpc/xpc_type_get_name(_:).md)
