node.js – How to determine the electron sha256 hash
There are a few ways to determine the SHA256 hash of Electron. One way is to use the shasum command-line tool. To do this, open a terminal window and navigate to the directory where the Electron binary is located. Then, run the following command:
shasum -a 256 electron.exe
This will output the SHA256 hash of the Electron binary.
Another way to determine the SHA256 hash of Electron is to use the crypto module in Node.js. To do this, create a new Node.js script and save it as get-electron-sha256.js. Then, add the following code to the script:
const crypto = require('crypto');
const hash = crypto.createHash('sha256');
const file = require('fs').readFileSync('electron.exe');
hash.update(file);
const sha256 = hash.digest('hex');
console.log(sha256);
Save the script and then run it from the command line:
node get-electron-sha256.js
This will output the SHA256 hash of the Electron binary.
Finally, you can also determine the SHA256 hash of Electron by looking at the SHASUMS256.txt file that is included in the Electron download. This file lists the SHA256 hashes of all of the Electron binaries for each platform.
The SHA256 hash that you are using for v22.0.0 is incorrect. The correct hash is:
sha256:675dc6eec89d1ddd1fa1f035915944bbec766951c6cd149c5ddcc3056471a91d
The SHA256 hash that you are using for v25.3.2 is also incorrect. The correct hash is:
sha256:9855f574e4f1647b678d23529c81d5572201f4424680c4e27a823b192d636444
I hope this helps!
Read more here: Source link