MCPcopy
hub / github.com/ModelEngine-Group/nexent / arrayBufferToBase64

Function arrayBufferToBase64

frontend/lib/agentImportUtils.ts:22–33  ·  view source on GitHub ↗
(buffer: ArrayBuffer)

Source from the content-addressed store, hash-verified

20 * Uses chunking for better performance with large files
21 */
22export const arrayBufferToBase64 = (buffer: ArrayBuffer): string => {
23 let binary = "";
24 const bytes = new Uint8Array(buffer);
25 const chunkSize = 0x8000;
26
27 for (let i = 0; i < bytes.length; i += chunkSize) {
28 const chunk = bytes.subarray(i, i + chunkSize);
29 binary += String.fromCharCode(...chunk);
30 }
31
32 return btoa(binary);
33};
34
35/**
36 * Extract skill name from ZIP path (e.g. "skills/my-skill.zip" -> "my-skill")

Callers 2

importFromZipFunction · 0.90
parseAgentImportFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected