MCPcopy
hub / github.com/redis/go-redis / DigestString

Function DigestString

helper/helper.go:28–30  ·  view source on GitHub ↗

DigestString computes the xxh3 hash of the given string. This produces the same hash as the Redis DIGEST command, allowing you to calculate digests client-side without making a Redis call. This is useful for optimistic locking with SetIFDEQ, SetIFDNE, and DelExArgs.

(s string)

Source from the content-addressed store, hash-verified

26// calculate digests client-side without making a Redis call.
27// This is useful for optimistic locking with SetIFDEQ, SetIFDNE, and DelExArgs.
28func DigestString(s string) uint64 {
29 return xxh3.HashString(s)
30}

Calls

no outgoing calls