From d16e60e4a4985135d37d20944e4bbcc6c6ff19cb Mon Sep 17 00:00:00 2001 From: melissa Date: Sun, 12 Jan 2025 19:40:59 -0800 Subject: [PATCH] feat: replace crypto with murmurhash for cli caching (#850) --- packages/cli/src/cache.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/cache.js b/packages/cli/src/cache.js index a75a74771..2346a4143 100644 --- a/packages/cli/src/cache.js +++ b/packages/cli/src/cache.js @@ -8,7 +8,9 @@ */ import fs from 'fs/promises'; import path from 'path'; -import crypto from 'crypto'; +const { utils } = require('@stylexjs/shared'); + +const hash = utils.hash; // Default cache directory in `node_modules/.stylex-cache` export function getDefaultCachePath() { @@ -94,5 +96,5 @@ export async function computeHash(filePath) { } const content = await fs.readFile(newPath, 'utf-8'); - return crypto.createHash('md5').update(content).digest('hex'); + return hash(content); }