Buffer.alloc should be .from

This commit is contained in:
David Stephens 2018-04-29 12:01:34 +01:00
parent b45a6a8743
commit f692c593e7
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ module.exports = class ArchiveUtil {
Object.keys(Config.fileTypes).forEach(mimeType => { Object.keys(Config.fileTypes).forEach(mimeType => {
const fileType = Config.fileTypes[mimeType]; const fileType = Config.fileTypes[mimeType];
if(fileType.sig) { if(fileType.sig) {
fileType.sig = Buffer.alloc(fileType.sig, 'hex'); fileType.sig = Buffer.from(fileType.sig, 'hex');
fileType.offset = fileType.offset || 0; fileType.offset = fileType.offset || 0;
// :TODO: this is broken: sig is NOT this long, it's sig.length long; offset needs to allow for -negative values as well // :TODO: this is broken: sig is NOT this long, it's sig.length long; offset needs to allow for -negative values as well