flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
18
VISUALIZACION/node_modules/parcel-bundler/lib/utils/md5.js
generated
vendored
Executable file
18
VISUALIZACION/node_modules/parcel-bundler/lib/utils/md5.js
generated
vendored
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
'use strict';
|
||||
|
||||
const crypto = require('crypto');
|
||||
const fs = require('fs');
|
||||
|
||||
function md5(string) {
|
||||
return crypto.createHash('md5').update(string).digest('hex');
|
||||
}
|
||||
|
||||
md5.file = function (filename) {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.createReadStream(filename).pipe(crypto.createHash('md5').setEncoding('hex')).on('finish', function () {
|
||||
resolve(this.read());
|
||||
}).on('error', reject);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = md5;
|
||||
Loading…
Add table
Add a link
Reference in a new issue