electron/script/gn-asar-hash.js
Samuel Attard e9cb85bea6
build: add import/order eslint rule (#44106)
build: add import/order eslint rule (#44085)

* build: add import/order eslint rule

* chore: run lint:js --fix
2024-10-02 20:52:01 -07:00

10 lines
325 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'));