# CompositeKeyHashCode

Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/CompositeKeyHashCode.+class:androidx.compose.runtime.CompositeKeyHashCode) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.10.0) Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  class CompositeKeyHashCode
  ```
- Cmn android

  ```
  actual typealias CompositeKeyHashCode = Long
  ```

*** ** * ** ***

The return type of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#currentCompositeKeyHashCode()`. On most platforms this is a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` but may be a different type if the platform target does not support `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` efficiently (such as JavaScript).

A `CompositeKeyHashCode` is a hash that correlates to a location in a Composition. Hashes are stable, meaning that if the same composition hierarchy is recomposed or recreated, it will have the same hashes. Hashes are very likely, but not guaranteed, to be unique.

If you need to convert this value to an Int, it is strongly recommended to use `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/hash-code.html` instead of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-number/to-int.html`. Truncating this value instead of hashing it can greatly impact a value's effectiveness as a hash.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#currentCompositeKeyHashCode()` |   |

## Summary

| ### Extension functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositeKeyHashCode.https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositeKeyHashCode#(androidx.compose.runtime.CompositeKeyHashCode).toLong()()` Converts a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositeKeyHashCode` to a 64-bit Long. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositeKeyHashCode.https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositeKeyHashCode#(androidx.compose.runtime.CompositeKeyHashCode).toString(kotlin.Int)(radix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns a String representation of a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositeKeyHashCode` with the specified `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#(androidx.compose.runtime.CompositeKeyHashCode).toString(kotlin.Int)`. | Cmn |

## Extension functions

### CompositeKeyHashCode.toLong

Cmn Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/CompositeKeyHashCode.kt+function:toLong)

```
fun CompositeKeyHashCode.toLong(): Long
```

Converts a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositeKeyHashCode` to a 64-bit Long. This may be higher precision than the underlying type.

### CompositeKeyHashCode.toString

Cmn Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/CompositeKeyHashCode.kt+function:toString)

```
fun CompositeKeyHashCode.toString(radix: Int): String
```

Returns a String representation of a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositeKeyHashCode` with the specified `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#(androidx.compose.runtime.CompositeKeyHashCode).toString(kotlin.Int)`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | when `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#(androidx.compose.runtime.CompositeKeyHashCode).toString(kotlin.Int)` is not a valid radix for number to string conversion. |