0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/functional/lib/test.utils.js
2017-07-30 15:56:00 +00:00

13 lines
334 B
JavaScript

const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
exports.generateSha = function generateSha(key) {
return crypto.createHash('sha1', 'binary').update(key).digest('hex');
};
exports.readFile = function readFile(filePath) {
return fs.readFileSync(path.join(__dirname, `/${filePath}`));
}