static fromBase64(str) {
    // atob creates a "raw string" where each character is interpreted as a
    // byte.
    const bytes = window.atob(str.replace(/-/g, '+').replace(/_/g, '/'));
    const result = new Uint8Array(bytes.length);
    for (let i = 0; i < bytes.length; ++i) {
      result[i] = bytes.charCodeAt(i);
    }
    return result;
  }
Convert a base64 string to a Uint8Array.  Accepts either the standard
alphabet or the alternate "base64url" alphabet.
@param {string} str
@return {!Uint8Array}
@export