Browse Source

hash: return SHA -> file

master
Guillermo Rauch 9 years ago
parent
commit
d58021f099
  1. 2
      lib/hash.js

2
lib/hash.js

@ -11,7 +11,7 @@ import { createHash } from 'crypto';
export default async function hashes (files) { export default async function hashes (files) {
const entries = await Promise.all(files.map(async (file) => { const entries = await Promise.all(files.map(async (file) => {
const data = await fs.readFile(file); const data = await fs.readFile(file);
return [file, hash(data)]; return [hash(data), file];
})); }));
return new Map(entries); return new Map(entries);
} }

Loading…
Cancel
Save