{
  "schema_version": 2,
  "id": "commands/digest",
  "title": "DIGEST",
  "url": "https://redis.io/docs/latest/commands/digest/",
  "summary": "Returns the hash digest of a string value.",
  "since": "8.4.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T16:45:12+01:00",
  "page_type": "content",
  "content_hash": "e248f1b1973606f5566abc0dcd69d1ea2e068f6d3ed7a12f788dfe1a77618ed7",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Get the [hash digest](#hash-digest) for the value stored in the specified key as a hexadecimal string. Keys must be of type string."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "> SET key1 \"Hello world\"\nOK\n> DIGEST key1\n\"b6acb9d84a38ff74\""
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "hash-digest",
      "title": "Hash Digest",
      "role": "content",
      "text": "A hash digest is a fixed-size numerical representation of a string value, computed using the XXH3 hash algorithm. Redis uses this hash digest for efficient comparison operations without needing to compare the full string content. You can use these hash digests with the [SET](https://redis.io/docs/latest/commands/set) command's `IFDEQ` and `IFDNE` options, and also the [DELEX](https://redis.io/docs/latest/commands/delex) command's `IFDEQ` and `IFDNE` options."
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n\n- [Null bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) if the key does not exist.\n- [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) if the key exists but holds a value which is not a string.\n- [Bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) the hash digest of the value stored in the key as a hexadecimal string.\n\n**RESP3:**\n\nOne of the following:\n\n- [Null bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) if the key does not exist.\n- [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) if the key exists but holds a value which is not a string.\n- [Bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) the hash digest of the value stored in the key as a hexadecimal string."
    }
  ],
  "examples": []
}
