2022-10-19 20:39:31 +00:00
|
|
|
const asar = require('@electron/asar');
|
2023-06-22 14:21:42 +00:00
|
|
|
const crypto = require('node:crypto');
|
|
|
|
const fs = require('node:fs');
|
2021-09-09 21:49:01 +00:00
|
|
|
|
|
|
|
const archive = process.argv[2];
|
|
|
|
const hashFile = process.argv[3];
|
|
|
|
|
|
|
|
const { headerString } = asar.getRawHeader(archive);
|
|
|
|
fs.writeFileSync(hashFile, crypto.createHash('SHA256').update(headerString).digest('hex'));
|