diff --git a/packages/metro-cache/src/stableHash.js b/packages/metro-cache/src/stableHash.js index 133c3755..040e5b91 100644 --- a/packages/metro-cache/src/stableHash.js +++ b/packages/metro-cache/src/stableHash.js @@ -32,7 +32,7 @@ function stableHash(value: mixed) { return crypto .createHash('md4') .update(JSON.stringify(value, canonicalize)) - .digest(); + .digest('buffer'); } module.exports = stableHash; diff --git a/packages/metro/src/shared/output/meta.js b/packages/metro/src/shared/output/meta.js index e761ecaf..bee3cbcd 100644 --- a/packages/metro/src/shared/output/meta.js +++ b/packages/metro/src/shared/output/meta.js @@ -31,7 +31,7 @@ module.exports = function( const buffer: Buffer = asBuffer(code, encoding); const hash = crypto.createHash('sha1'); hash.update(buffer); - const digest = hash.digest(); + const digest = hash.digest('buffer'); const signature = Buffer.alloc ? Buffer.alloc(digest.length + 1) : new Buffer(digest.length + 1);