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

Function DigestBytes

helper/helper.go:20–22  ·  view source on GitHub ↗

DigestBytes computes the xxh3 hash of the given byte slice. 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.

(data []byte)

Source from the content-addressed store, hash-verified

18// calculate digests client-side without making a Redis call.
19// This is useful for optimistic locking with SetIFDEQ, SetIFDNE, and DelExArgs.
20func DigestBytes(data []byte) uint64 {
21 return xxh3.Hash(data)
22}
23
24// DigestString computes the xxh3 hash of the given string.
25// This produces the same hash as the Redis DIGEST command, allowing you to

Calls 1

HashMethod · 0.45