aboutsummaryrefslogtreecommitdiff
path: root/src/js/utils.js
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-07-21 16:43:41 +0300
committerkaotisk <kaotisk@arching-kaos.org>2025-07-21 16:43:41 +0300
commit81c170c99f58e28270fb5306b759b231578e36a9 (patch)
tree9e442cc6baa98cda0566493e40f7c4491cda1873 /src/js/utils.js
parent8ad73165db077ced4d9ced285eb5371ac746c5cc (diff)
downloadarching-kaos-web-ui-81c170c99f58e28270fb5306b759b231578e36a9.tar.gz
arching-kaos-web-ui-81c170c99f58e28270fb5306b759b231578e36a9.tar.bz2
arching-kaos-web-ui-81c170c99f58e28270fb5306b759b231578e36a9.zip
AKNS records resolver + Donations page
Diffstat (limited to 'src/js/utils.js')
-rw-r--r--src/js/utils.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/js/utils.js b/src/js/utils.js
index a952328..6a355a8 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -35,4 +35,17 @@ export function offerDownloadableData(data)
link.href = window.URL.createObjectURL(blob);
link.click();
}
+
+export function decodeBase64ToHex(base64String) {
+ const binaryString = atob(base64String);
+ // Convert the binary string to a byte array
+ const byteArray = new Uint8Array(binaryString.length);
+ for (let i = 0; i < binaryString.length; i++) {
+ byteArray[i] = binaryString.charCodeAt(i);
+ }
+ // Convert the byte array to a hex string representation
+ return Array.from(byteArray)
+ .map(byte => byte.toString(16).padStart(2, '0')) // Convert to hex and pad with zeros
+ .join(''); // Join with spaces for readability
+}
// @license-end