mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
14 lines
334 B
JavaScript
14 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}`));
|
|
}
|