Implement RSA verification (#4952)

Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: cairo <cairoeth@protonmail.com>
This commit is contained in:
Hadrien Croubois
2024-06-11 19:16:30 +02:00
committed by GitHub
parent de4154710b
commit d8e799db98
7 changed files with 4145 additions and 0 deletions

View File

@ -0,0 +1,17 @@
const path = require('path');
const fs = require('fs');
module.exports = function* parse(file) {
const cache = {};
const data = fs.readFileSync(path.resolve(__dirname, file), 'utf8');
for (const line of data.split('\r\n')) {
const groups = line.match(/^(?<key>\w+) = (?<value>\w+)(?<extra>.*)$/)?.groups;
if (groups) {
const { key, value, extra } = groups;
cache[key] = value;
if (groups.key === 'Result') {
yield Object.assign({ extra: extra.trim() }, cache);
}
}
}
};