mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
93468211d6
* chore: update eslint * chore: update rules and style * chore: aling formatting * chore: update ci rules * chore: aling formatting * chore: aling formatting
20 lines
377 B
TypeScript
20 lines
377 B
TypeScript
import crypto from 'crypto';
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
function generateSha(key) {
|
|
// @ts-ignore
|
|
return (
|
|
crypto
|
|
// @ts-ignore
|
|
.createHash('sha1', 'binary')
|
|
.update(key)
|
|
.digest('hex')
|
|
);
|
|
}
|
|
|
|
function readFile(filePath) {
|
|
return fs.readFileSync(path.join(__dirname, `/${filePath}`));
|
|
}
|
|
|
|
export { generateSha, readFile };
|