MCPcopy Create free account
hub / github.com/DFin/Neural-Network-Visualisation / decodeBase64ToUint8Array

Function decodeBase64ToUint8Array

assets/main.js:689–703  ·  view source on GitHub ↗
(base64)

Source from the content-addressed store, hash-verified

687}
688
689function decodeBase64ToUint8Array(base64) {
690 if (typeof atob === "function") {
691 const binary = atob(base64);
692 const length = binary.length;
693 const bytes = new Uint8Array(length);
694 for (let i = 0; i < length; i += 1) {
695 bytes[i] = binary.charCodeAt(i);
696 }
697 return bytes;
698 }
699 if (typeof Buffer === "function") {
700 return Uint8Array.from(Buffer.from(base64, "base64"));
701 }
702 throw new Error("Base64-Dekodierung ist in dieser Umgebung nicht verfügbar.");
703}
704
705function float16ToFloat32(value) {
706 const sign = (value & 0x8000) >> 15;

Callers 1

decodeFloat16Base64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected