한글뷰어 기능수정 Ver.01
This commit is contained in:
14
scratch_check_header.js
Normal file
14
scratch_check_header.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const fileData = fs.readFileSync('downloaded_test.hwpx');
|
||||
const hex = fileData.subarray(0, 16).toString('hex').toUpperCase();
|
||||
console.log('Hex signature of first 16 bytes:');
|
||||
console.log(hex.match(/.{1,2}/g).join(' '));
|
||||
|
||||
if (hex.startsWith('D0CF11E0A1B11AE1')) {
|
||||
console.log('File type: OLE Compound File (standard HWP binary)');
|
||||
} else if (hex.startsWith('504B0304')) {
|
||||
console.log('File type: ZIP file (standard HWPX)');
|
||||
} else {
|
||||
console.log('File type: Unknown');
|
||||
}
|
||||
Reference in New Issue
Block a user