engineer-man / piston

A high performance general purpose code execution engine.
https://emkc.org/run
MIT License
1.95k stars 251 forks source link

What's the idiomatic way of dealing binary data? #648

Open Louis-Tian opened 7 months ago

Louis-Tian commented 7 months ago

Say for example, we use piston to process some images. what's the most idiomatic way of passing the image into the Piston and how to get it back after the processing? Is this supported at all right now?

Brikaa commented 7 months ago

To pass it, encode it as base64 and specify files[].encoding to be 'base64'

To get it back, I think our only option is to output it as base64 in the running submission, and decode the result from stdout