officecrypto-tool
Advanced tools
Comparing version 0.0.9 to 0.0.10
41
index.js
@@ -69,3 +69,8 @@ /* eslint-disable valid-jsdoc */ | ||
if (Workbook) { | ||
output = xls97File.decrypt(cfb, Workbook.content, password, input); | ||
let workbookContent = Workbook.content; | ||
if (!Buffer.isBuffer(workbookContent)) { | ||
workbookContent = Buffer.from(workbookContent); | ||
CFB.utils.prep_blob(workbookContent, 0); | ||
} | ||
output = xls97File.decrypt(cfb, workbookContent, password, input); | ||
return output; | ||
@@ -76,3 +81,8 @@ } | ||
if (WordWorkbook) { | ||
output = doc97File.decrypt(cfb, WordWorkbook.content, password, input); | ||
let wordWorkbookContent = WordWorkbook.content; | ||
if (!Buffer.isBuffer(wordWorkbookContent)) { | ||
wordWorkbookContent = Buffer.from(wordWorkbookContent); | ||
CFB.utils.prep_blob(wordWorkbookContent, 0); | ||
} | ||
output = doc97File.decrypt(cfb, wordWorkbookContent, password, input); | ||
return output; | ||
@@ -83,3 +93,8 @@ } | ||
if (PowerPointBook) { | ||
output = ppt97File.decrypt(cfb, PowerPointBook.content, password, input); | ||
let powerPointBookContent = PowerPointBook.content; | ||
if (!Buffer.isBuffer(powerPointBookContent)) { | ||
powerPointBookContent = Buffer.from(powerPointBookContent); | ||
CFB.utils.prep_blob(powerPointBookContent, 0); | ||
} | ||
output = ppt97File.decrypt(cfb, powerPointBookContent, password, input); | ||
return output; | ||
@@ -145,3 +160,6 @@ } | ||
let blob = Workbook.content; | ||
if (!Buffer.isBuffer(blob)) blob = Buffer.from(blob); | ||
if (!Buffer.isBuffer(blob)) { | ||
blob = Buffer.from(blob); | ||
CFB.utils.prep_blob(blob, 0); | ||
} | ||
const bof = blob.read_shift(2); | ||
@@ -159,3 +177,6 @@ const bofSize = blob.read_shift(2); | ||
let blob = WordDocument.content; | ||
if (!Buffer.isBuffer(blob)) blob = Buffer.from(blob); | ||
if (!Buffer.isBuffer(blob)) { | ||
blob = Buffer.from(blob); | ||
CFB.utils.prep_blob(blob, 0); | ||
} | ||
const fibBase = doc97File.parseFibBase(blob); | ||
@@ -171,7 +192,13 @@ const fEncrypted = fibBase.fEncrypted; | ||
let blob = PowerPointBook.content; | ||
if (!Buffer.isBuffer(blob)) blob = Buffer.from(blob); | ||
if (!Buffer.isBuffer(blob)) { | ||
blob = Buffer.from(blob); | ||
CFB.utils.prep_blob(blob, 0); | ||
} | ||
const CurrentUser = CFB.find(cfb, 'Current User'); | ||
let currentUserBlob = CurrentUser.content; | ||
if (!Buffer.isBuffer(currentUserBlob)) currentUserBlob = Buffer.from(currentUserBlob); | ||
if (!Buffer.isBuffer(currentUserBlob)) { | ||
currentUserBlob = Buffer.from(currentUserBlob); | ||
CFB.utils.prep_blob(currentUserBlob, 0); | ||
} | ||
@@ -178,0 +205,0 @@ const currentUser = ppt97File.parseCurrentUser(currentUserBlob); |
{ | ||
"name": "officecrypto-tool", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "officeCrypto is a library for node.js that can be used to decrypt and encrypt excel files.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
802488
3130