Download packages/core/src/utils/cryptoUtils.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 538 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/core/src/utils/cryptoUtils.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/core/src/utils/cryptoUtils.ts
-
curl -L -o cryptoUtils.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/core/src/utils/cryptoUtils.ts
538 Bytes
| /** | |
| * @license | |
| * Copyright 2026 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { createHash } from 'node:crypto'; | |
| /** | |
| * Derives a stable, deterministic ID from a list of source IDs. | |
| * Used for synthetic turns like summaries to ensure that re-summarizing the same | |
| * content produces a consistent identity. | |
| */ | |
| export function deriveStableId(sourceIds: string[]): string { | |
| const sortedIds = [...sourceIds].sort(); | |
| return createHash('sha256') | |
| .update(sortedIds.join('|')) | |
| .digest('hex') | |
| .slice(0, 32); | |
| } | |