diff options
Diffstat (limited to 'signing')
-rw-r--r-- | signing/sign.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/signing/sign.js b/signing/sign.js index 116a6a9..2e1c23d 100644 --- a/signing/sign.js +++ b/signing/sign.js @@ -1,6 +1,10 @@ const fs = require('fs'); const crypto = require('crypto'); -global.sdb = {}; +global.sdb = { + "v1": {}, + "v2": {}, + "v3": {} +}; function scan(start) { rt = fs.readdirSync(start); @@ -10,14 +14,20 @@ function scan(start) { scan(start + "/" + file); } else { sign = crypto.createHash('sha512').update(fs.readFileSync(start + "/" + file)).digest('base64') - console.log("Signed: " + start + "/" + file + ": " + sign); - sdb[(start + "/" + file).substr(1)] = sign; + console.log("Signed (SHA-512): " + start + "/" + file + ": " + sign); + sdb["v1"][(start + "/" + file).substr(1)] = sign; + + sign = crypto.createHash('sha1').update(fs.readFileSync(start + "/" + file)).digest('base64') + console.log("Signed (SHA-1): " + start + "/" + file + ": " + sign); + sdb["v2"][(start + "/" + file).substr(1)] = sign; + + sign = crypto.createHash('md5').update(fs.readFileSync(start + "/" + file)).digest('base64') + console.log("Signed (MD5): " + start + "/" + file + ": " + sign); + sdb["v3"][(start + "/" + file).substr(1)] = sign; } } } } scan(".."); -scan("../node_modules/electron"); -scan("../node_modules/@electron"); fs.writeFileSync("../bin/signatures.json", JSON.stringify(sdb));
\ No newline at end of file |