📜  检测图像中的 Base 64 编码 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:16.338000             🧑  作者: Mango

代码示例1
var base64Matcher = new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$");

// ...

if (base64Matcher.test(someString)) {
    // It's likely base64 encoded.
} else {
    // It's definitely not base64 encoded.
}