Skip to content

Commit

Permalink
fixes sysgears#12 crypto warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
veeramarni committed Dec 22, 2019
1 parent 5c907d4 commit 285a71f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/zen/src/executor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { exec, spawn } from 'child_process';
import cluster from 'cluster';
import * as cors from 'connect-cors';
import * as crypto from 'crypto';
import { createHash } from 'crypto';
import Debug from 'debug';
import * as detectPort from 'detect-port';
import * as fs from 'fs';
Expand Down Expand Up @@ -934,8 +934,7 @@ const isDllValid = (zen, builder, logger): boolean => {
logger.warn(`${name} DLL need to be regenerated, file: ${filename} is missing.`);
return false;
}
const hash = crypto
.createHash('md5')
const hash = createHash('md5')
.update(fs.readFileSync(filename))
.digest('hex');
if (relMeta.hashes[filename] !== hash) {
Expand Down Expand Up @@ -988,8 +987,7 @@ const buildDll = (zen: Zen, builder: Builder) => {
const meta = { name: vendorKey, hashes: {}, modules: config.entry.vendor, version: LARIX_DLL_VERSION };
for (const filename of Object.keys(json.content)) {
if (filename.indexOf(' ') < 0 && filename.indexOf('@virtual') < 0) {
meta.hashes[filename] = crypto
.createHash('md5')
meta.hashes[filename] = createHash('md5')
.update(fs.readFileSync(filename.split('!').pop()))
.digest('hex');
}
Expand Down

0 comments on commit 285a71f

Please sign in to comment.