MCPcopy Create free account
hub / github.com/Hattorius/CipherDrop / base64UrlToArrayBuffer

Function base64UrlToArrayBuffer

frontend/file.js:117–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117const base64UrlToArrayBuffer = string => {
118 const base64String = string.replace(/-/g, '+').replace(/_/g, '/');
119 const binaryString = atob(base64String);
120 const len = binaryString.length;
121 const bytes = new Uint8Array(len);
122 for (let i = 0; i < len; i++) {
123 bytes[i] = binaryString.charCodeAt(i);
124 }
125 return bytes.buffer;
126}
127
128const decryptFile = async (encryptedData, encodedKey, encodedIv, mimeType, fileName) => {
129 const rawKey = base64UrlToArrayBuffer(encodedKey);

Callers 1

decryptFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected