DIGEST
Syntax
DIGEST key
- Available since:
- Redis Open Source 8.4.0
- Time complexity:
- O(N) where N is the length of the string value.
- ACL categories:
-
@read,@string,@fast,
Get the hash digest for the value stored in the specified key as a hexadecimal string. Keys must be of type string.
Hash Digest
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 command's IFDEQ and IFDNE options, and also the DELEX command's IFDEQ and IFDNE options.
Redis Software and Redis Cloud compatibility
| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ❌ Standard |
❌ Standard |
Return information
One of the following:
- Null bulk string reply if the key does not exist.
- Simple error reply if the key exists but holds a value which is not a string.
- Bulk string reply the hash digest of the value stored in the key as a hexadecimal string.