### Function

# GLib direct_hash

since: 2.0

#### Declaration

    guint
    g_direct_hash (
      gconstpointer v
    )

#### Description

Converts a gpointer to a hash value. It can be passed to `g_hash_table_new()` as the `hash_func` parameter, when using opaque pointers compared by pointer value as keys in a `GHashTable`.

This hash function is also appropriate for keys that are integers stored in pointers, such as `GINT_TO_POINTER (n)`.

Available since: 2.0

#### Parameters

`v`

  Type: `gconstpointer`

  A #gpointer key.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

#### Return value

Type: `guint`

A hash value corresponding to the key.