MCPcopy
hub / github.com/redis/node-redis / digest

Function digest

packages/client/lib/utils/digest.ts:31–36  ·  view source on GitHub ↗
(value: RedisArgument)

Source from the content-addressed store, hash-verified

29 * @throws If the `@node-rs/xxhash` package is not found
30 */
31export async function digest(value: RedisArgument): Promise<string> {
32 const xxh3 = await getXxh3();
33 const data = typeof value === 'string' ? value : new Uint8Array(value);
34 const hash = xxh3.xxh64(data);
35 return hash.toString(16).padStart(16, '0');
36}
37

Callers 2

digest.spec.tsFile · 0.90
cas-cad-digest.jsFile · 0.85

Calls 2

getXxh3Function · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected