Closed TheCGDF closed 4 years ago
I'd just use the base64 crate for this, I did this and its a one liner:
let png_byte_array = captcha.as_png().expect("failed to generate captcha");
let png = base64::encode(png_byte_array);
I justed added a method as_base64() which returns the a png encoded as base64. @TheCGDF thank you for your feature request and @dessalines thank you for your example.
encode binary data with base64 so that the data can be contained in JSON easily. i think it is useful.