I have an image buffer returned from a C SDK,
I can write to a local image and read it as base64
string but this requires an extra step.
How can I turn the byte array into a base64 string directly so that I can send it in a network request?
image = (ctypes.c_ubyte*s.dwDataLen)()
ctypes.memmove(image, s.pBuffer, s.dwDataLen)
I tried using base64.encodestring
but got this error
TypeError: expected single byte elements, not '<B' from c_ubyte_Array_8716