Skip to content

Commit

Permalink
feat: replace crypto with murmurhash for cli caching (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
mellyeliu authored Jan 13, 2025
1 parent 06ffe7e commit d16e60e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli/src/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
}

0 comments on commit d16e60e

Please sign in to comment.