diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-05 17:29:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-05 17:29:18 +0200 |
commit | b865b8f6586ffd4554cdfe45c739030afc882acd (patch) | |
tree | 37bcdf6575d8764b7367f34544658886879c0c5e /signing | |
parent | 79edea37d15f88f086f7775bbbce64a57535b043 (diff) | |
parent | 7b541bbf2a8d754d26511895801d90f02cdf99f7 (diff) | |
download | kartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.tar.gz kartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.tar.bz2 kartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.zip |
Merge pull request #4 from Minteck-Projects/devel
Branching 21.08
Diffstat (limited to 'signing')
-rw-r--r-- | signing/sign.js | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/signing/sign.js b/signing/sign.js index 2e1c23d..aa91be3 100644 --- a/signing/sign.js +++ b/signing/sign.js @@ -1,33 +1,33 @@ -const fs = require('fs'); -const crypto = require('crypto'); -global.sdb = { - "v1": {}, - "v2": {}, - "v3": {} -}; - -function scan(start) { - rt = fs.readdirSync(start); - for (file of rt) { - if (file !== ".git" && file !== "build" && file !== "signatures.json" && file !== "staging" && file !== "node_modules" && !file.endsWith(".staging") && !file.endsWith(".old") && file !== "_translate") { - if (fs.lstatSync(start + "/" + file).isDirectory()) { - scan(start + "/" + file); - } else { - sign = crypto.createHash('sha512').update(fs.readFileSync(start + "/" + file)).digest('base64') - 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(".."); -fs.writeFileSync("../bin/signatures.json", JSON.stringify(sdb));
\ No newline at end of file +const fs = require('fs');
+const crypto = require('crypto');
+global.sdb = {
+ "v1": {},
+ "v2": {},
+ "v3": {}
+};
+
+function scan(start) {
+ rt = fs.readdirSync(start);
+ for (file of rt) {
+ if (file !== ".git" && file !== "build" && file !== "signatures.json" && file !== "staging" && file !== "node_modules" && !file.endsWith(".staging") && !file.endsWith(".old") && file !== "_translate" && file !== "macos") {
+ if (fs.lstatSync(start + "/" + file).isDirectory()) {
+ scan(start + "/" + file);
+ } else {
+ sign = crypto.createHash('sha512').update(fs.readFileSync(start + "/" + file)).digest('base64')
+ 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("..");
+fs.writeFileSync("../bin/signatures.json", JSON.stringify(sdb));
|