getMFAResponseForSite - rendering array as a captcha image

北城余情 提交于 2019-12-06 14:58:44

The CAPTCHA image is being returned in String which is byte array of image. You need to convert this string into byte array and then into image. You can do this by using JDK libraries i.e. no external libraries are required.

You can use these.

java.awt.image.BufferedImage;
java.io.BufferedReader;
java.io.ByteArrayInputStream;
Dmitriy Paul

For me this was a best solution:

$string = implode(array_map("chr", $image));

Here you can find different realizations: How can I convert array of bytes to a string in PHP?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!