electron/script/gn-asar-hash.js
Milan Burda abec9ead06
refactor: use node scheme imports in scripts (#38846)
* refactor: use node scheme imports in script

* refactor: use node scheme imports in build
2023-06-22 16:21:42 +02:00

9 lines
324 B
JavaScript

const asar = require('@electron/asar');
const crypto = require('node:crypto');
const fs = require('node:fs');
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'));