I need a way to know if a string is Base64 encoded... any idea ?
thanks
字符串长度必须是4的倍数,并且仅允许以下字符AZ,az,0-9 * + ,* /和=作为填充字符(仅在末尾)
IMHO you need to try to decode it, and if it fails - it is not encoded.
There are many Base64 decoders for Java, here are some:
sun.misc.BASE64Decoder
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.