crypt.js
function(base64) {
      // Remove non-base-64 characters
      base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');

      for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
          imod4 = ++i % 4) {
        if (imod4 == 0) continue;
        bytes.push(((base64map.indexOf(base64.charAt(i - 1))
            & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
            | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
      }
      return bytes;
    }
function(base64) {
      // Remove non-base-64 characters
      base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');

      for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
          imod4 = ++i % 4) {
        if (imod4 == 0) continue;
        bytes.push(((base64map.indexOf(base64.charAt(i - 1))
            & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
            | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
      }
      return bytes;
    }
function ( base64 ) { // Remove non-base-64 characters base64 = base64 . replace ( / [^A-Z0-9+\/] / ig , '' ) ; for ( var bytes = [ ] , i = 0 , imod4 = 0 ; i < base64 . length ; imod4 = ++ i % 4 ) { if ( imod4 == 0 ) continue ; bytes . push ( ( ( base64map . indexOf ( base64 . charAt ( i - 1 ) ) & ( Math . pow ( 2 , - 2 * imod4 + 8 ) - 1 ) ) << ( imod4 * 2 ) ) | ( base64map . indexOf ( base64 . charAt ( i ) ) >>> ( 6 - imod4 * 2 ) ) ) ; } return bytes ; }
Convert a base-64 string to a byte array
Convert a base - 64 string to a byte array