mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
15 lines
311 B
JavaScript
15 lines
311 B
JavaScript
|
|
import crypto from 'crypto';
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
function generateSha(key) {
|
|
return crypto.createHash('sha1', 'binary').update(key).digest('hex');
|
|
}
|
|
|
|
function readFile(filePath) {
|
|
return fs.readFileSync(path.join(__dirname, `/${filePath}`));
|
|
}
|
|
|
|
export { generateSha, readFile }
|