MCPcopy Index your code
hub / github.com/socketio/socket.io / encodeBlobAsBase64

Function encodeBlobAsBase64

client-dist/socket.io.js:313–320  ·  view source on GitHub ↗
(data, callback)

Source from the content-addressed store, hash-verified

311 return callback(PACKET_TYPES[type] + (data || ""));
312 };
313 var encodeBlobAsBase64 = function encodeBlobAsBase64(data, callback) {
314 var fileReader = new FileReader();
315 fileReader.onload = function () {
316 var content = fileReader.result.split(",")[1];
317 callback("b" + (content || ""));
318 };
319 return fileReader.readAsDataURL(data);
320 };
321 function toArray(data) {
322 if (data instanceof Uint8Array) {
323 return data;

Callers 1

encodePacketFunction · 0.85

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected