pwa/pwa.js
/**
         * Covert urlBase64 To Uint8Array
         * @param  {String}     base64String base64 string
         * @return {Uint8Array} Uint8Array
         */
Covert urlBase64 To Uint8Array
@param  {String}     base64String base64 string
@return {Uint8Array} Uint8Array
Covert urlBase64 To Uint8Array @param { String } base64String base64 string @return { Uint8Array } Uint8Array
static urlBase64ToUint8Array(base64String) {
            const padding = '='.repeat((4 - base64String.length % 4) % 4);
            const base64 = (base64String + padding)
                .replace(/\-/g, '+')
                .replace(/_/g, '/');
            const rawData = window.atob(base64);
            const outputArray = new Uint8Array(rawData.length);
            for (var i = 0; i < rawData.length; ++i) {
                outputArray[i] = rawData.charCodeAt(i);
            }
            return outputArray;
        }
static urlBase64ToUint8Array ( base64String ) { const padding = '=' . repeat ( ( 4 - base64String . length % 4 ) % 4 ) ; const base64 = ( base64String + padding ) . replace ( / \- / g , '+' ) . replace ( / _ / g , '/' ) ; const rawData = window . atob ( base64 ) ; const outputArray = new Uint8Array ( rawData . length ) ; for ( var i = 0 ; i < rawData . length ; ++ i ) { outputArray [ i ] = rawData . charCodeAt ( i ) ; } return outputArray ; }
Covert urlBase64 To Uint8Array
 @param  {String}     base64String base64 string
 @return {Uint8Array} Uint8Array
Covert urlBase64 To Uint8Array @param { String } base64String base64 string @return { Uint8Array } Uint8Array