MCPcopy
hub / github.com/cyrildiagne/ar-cutpaste / arrayBufferToBase64

Function arrayBufferToBase64

app/components/Server.tsx:5–10  ·  view source on GitHub ↗
(buffer: ArrayBuffer)

Source from the content-addressed store, hash-verified

3const URL = "http://192.168.1.29:8080";
4
5function arrayBufferToBase64(buffer: ArrayBuffer) {
6 let binary = "";
7 const bytes = [].slice.call(new Uint8Array(buffer));
8 bytes.forEach((b) => (binary += String.fromCharCode(b)));
9 return Base64.btoa(binary);
10}
11
12function ping() {
13 fetch(URL + "/ping").catch((e) => console.error(e));

Callers 1

cutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected