; статичное количество воркеров
pm = static
; 12 воркеров
pm.max_children = 12
pm.start_servers = 12
let Tools = {};
function hex(buffer) {
let hexCodes = [];
let view = new DataView(buffer);
for (let i = 0; i < view.byteLength; i += 4) {
let stringValue = view.getUint32(i).toString(16);
let padding = '00000000';
hexCodes.push((padding + stringValue).slice(-padding.length));
}
return hexCodes.join('');
}
Object.assign(Tools, {
sha1: async (str) => hex(await crypto.subtle.digest('SHA-1', new TextEncoder('utf-8').encode(str)))
});
(async () => {
let result = await Tools.sha1('Blabla1a');
console.log(result);
})();
cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git
<allow-intent href="*://testyroki.abyshev.com/*"/>