Search
 
SCRIPT & CODE EXAMPLE
 

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;
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: stackoverflow array reduce 
Javascript :: jQuery.easing[this.easing] is not a function 
Javascript :: javascript upload json 
Javascript :: javascript wait 10 seconds 
Javascript :: jest mock react router params 
Javascript :: angular usehash not working 
Javascript :: lip. dips *dipped. also mm bpi. -opp. -ditty 
Javascript :: fakepath js 
Javascript :: save in json file js 
Javascript :: redirect angular 
Javascript :: html form clear 
Javascript :: setlocalstorage 
Javascript :: check if js string begin with word 
Javascript :: clear canvas for redrawing 
Javascript :: footer dynamic copyright reactjs 
Javascript :: Chart is not a constructor 
Javascript :: jquery remove background color 
Javascript :: Math prime js 
Javascript :: how to check if a string is correctly encoded as base64 in javascript 
Javascript :: shadowoffset react native constructor 
Javascript :: js string find regex 
Javascript :: get id button clicked react 
Javascript :: document is not defined javascript in nuxt js 
Javascript :: iframe in angular 
Javascript :: check either define or undefined in javascript 
Javascript :: even number function in javascript 
Javascript :: how to use ctrl c and ctrl v using vim vscode extension 
Javascript :: react-native curved view 
Javascript :: how to know type of dom element in js 
Javascript :: regex for 4 digit number javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =