🚨 Fixed DeepSource issues

This commit is contained in:
Mawoka
2023-06-14 16:33:44 +02:00
parent 6673a77b8a
commit db26082a00
28 changed files with 47 additions and 68 deletions
+2
View File
@@ -42,10 +42,12 @@ export const mint = async (
// eslint-disable-next-line no-constant-condition
while (true) {
// skipcq: JS-0003
const data = new TextEncoder().encode(`${challenge}:${counter.toString(16)}`);
const hashBuffer = await crypto.subtle.digest('SHA-1', data);
const hashArray = Array.from(new Uint8Array(hashBuffer));
const digest = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
// skipcq: JS-0050
if (digest.slice(0, hex_digits) == zeros) {
result = counter.toString(16);
break;