Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js check if string is base64

function isBase64(str) {
    if (str ==='' || str.trim() ===''){ return false; }
    try {
        return btoa(atob(str)) == str;
    } catch (err) {
        return false;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #check #string
ADD COMMENT
Topic
Name
4+7 =