Answers for "Detect Base 64 encoding in images"

0

Detect Base 64 encoding in images

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.
}
Posted by: Guest on August-13-2021

Browse Popular Code Answers by Language