diff options
author | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-07-08 23:04:56 +0200 |
---|---|---|
committer | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-07-08 23:04:56 +0200 |
commit | a69a90e2f5970efb23dba5ca900e9624b35cfa36 (patch) | |
tree | 199819c1537d2f1d8d7c0c97d113e619a683c660 /signing | |
parent | f3e78ef8dbf6d89999fdfe1a4022ef97c67a7514 (diff) | |
download | kartik-client-a69a90e2f5970efb23dba5ca900e9624b35cfa36.tar.gz kartik-client-a69a90e2f5970efb23dba5ca900e9624b35cfa36.tar.bz2 kartik-client-a69a90e2f5970efb23dba5ca900e9624b35cfa36.zip |
21.07 (2)
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 |