Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function hashFileAsync(filename, algo = 'sha512', encoding = 'base64') {
var builderUtil = require('builder-util');
return builderUtil.hashFile(filename, algo, encoding);
}
function hashFileAsync(filename, algo = 'sha512', encoding = 'base64') {
var builderUtil = require('builder-util');
return builderUtil.hashFile(filename, algo, encoding);
}
export async function createPackageFileInfo(file: string, blockMapSize: number): Promise {
return {
path: file,
size: (await stat(file)).size,
blockMapSize,
sha512: await hashFile(file),
}
}
export async function createPackageFileInfo(file: string): Promise {
return {
file,
size: (await stat(file)).size,
sha512: await hashFile(file),
}
}
function hashFileAsync(filename, algo = 'sha512', encoding = 'base64') {
const builderUtil = require('builder-util');
return builderUtil.hashFile(filename, algo, encoding);
}
async function createFileInfo(blockMapData: Buffer, file: string, fileSize: number): Promise {
return {
path: file,
size: fileSize,
blockMapSize: blockMapData.length,
blockMapData,
sha512: await hashFile(file),
}
}