From d5a620cf09b835db2bccd99556525c90b458719f Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 5 Aug 2021 17:21:23 +0200 Subject: i18n for 21.08 --- signing/sign.js | 66 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'signing') diff --git a/signing/sign.js b/signing/sign.js index bb8d534..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" && 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)); +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)); -- cgit