From e4c73503ee50ed76d49b1e61cd0d84527bfdfe6a Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Tue, 3 Jun 2025 17:27:40 +0200 Subject: [PATCH] fix: use sha1 instead of md5 for hashing --- packages/vitest/src/integrations/css/css-modules.ts | 2 +- packages/vitest/src/node/cache/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vitest/src/integrations/css/css-modules.ts b/packages/vitest/src/integrations/css/css-modules.ts index 6c553166d..06bbe736e 100644 --- a/packages/vitest/src/integrations/css/css-modules.ts +++ b/packages/vitest/src/integrations/css/css-modules.ts @@ -2,7 +2,7 @@ import type { CSSModuleScopeStrategy } from '../../node/types/config' import { hash } from '../../node/hash' export function generateCssFilenameHash(filepath: string): string { - return hash('md5', filepath, 'hex').slice(0, 6) + return hash('sha1', filepath, 'hex').slice(0, 6) } export function generateScopedClassName( diff --git a/packages/vitest/src/node/cache/index.ts b/packages/vitest/src/node/cache/index.ts index 5a1e4ceb9..1c8478ec3 100644 --- a/packages/vitest/src/node/cache/index.ts +++ b/packages/vitest/src/node/cache/index.ts @@ -29,7 +29,7 @@ export class VitestCache { root, baseDir, 'vitest', - hash('md5', projectName || '', 'hex'), + hash('sha1', projectName || '', 'hex'), ) } } -- 2.51.2