Extract shared binary utility helpers into VG-Core

Dieser Commit ist enthalten in:
2026-05-26 17:12:55 +02:00
Ursprung 28c09d5356
Commit ea328ef9d1
3 geänderte Dateien mit 27 neuen und 27 gelöschten Zeilen
-27
Datei anzeigen
@@ -532,33 +532,6 @@ function decodeTcStringCoreMetadata(tcString) {
}
}
function base64UrlToBits(value) {
const base64 = value
.replace(/-/g, "+")
.replace(/_/g, "/")
.padEnd(Math.ceil(value.length / 4) * 4, "=");
const binary = atob(base64);
let bits = "";
for (let index = 0; index < binary.length; index += 1) {
bits += binary
.charCodeAt(index)
.toString(2)
.padStart(8, "0");
}
return bits;
}
function bitsToInt(bits, start, length) {
return parseInt(bits.slice(start, start + length), 2);
}
function bitsToBoolean(bits, index) {
return bits[index] === "1";
}
function bitsToString(bits, start, length) {
let result = "";