How to use the js-base64.Base64.encodeURI function in js-base64

To help you get started, we’ve selected a few js-base64 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mermaidjs / mermaid-live-editor / src / components / Preview.js View on Github external
code,
      history,
      match: { url }
    } = this.props
    try {
      mermaid.parse(code)
      // Replacing special characters '<' and '>' with encoded '<' and '>'
      let _code = code
      _code = _code.replace(//g, '>')
      // Overriding the innerHTML with the updated code string
      this.container.innerHTML = _code
      mermaid.init(undefined, this.container)
    } catch (e) {
      // {str, hash}
      const base64 = Base64.encodeURI(e.str || e.message)
      history.push(`${url}/error/${base64}`)
    }
  }
github FlashAirDevelopers / FlashAirFileManager / src / main / auth.js View on Github external
_makeCodeVerifier() {
    // minimum raw length 32
    // see: https://tools.ietf.org/html/rfc7636#section-4.1
    return Base64.encodeURI(cryptoGenerateRandom(32));
  }
  // Base64url Encoding without Padding
github mermaid-js / mermaid / cypress / helpers / util.js View on Github external
export const mermaidUrl = (graphStr, options, api) => {
  const obj = {
    code: graphStr,
    mermaid: options
  };
  const objStr = JSON.stringify(obj);
  let url = 'http://localhost:9000/e2e.html?graph=' + Base64.encodeURI(objStr);
  if (api) {
    url = 'http://localhost:9000/xss.html?graph=' + graphStr;
  }

  if (options.listUrl) {
    cy.log(options.listId, ' ', url);
  }

  return url;
};
github mermaid-js / mermaid-live-editor / src / code-store.js View on Github external
export const updateCodeStore = newState => {
  codeStore.set(newState);
  push('/edit/' + Base64.encodeURI(JSON.stringify(newState)))
};
github imgix / react-imgix / src / constructUrl.js View on Github external
const keys = Object.keys(longOptions);
  const keysLength = keys.length;
  let url = src + "?";
  for (let i = 0; i < keysLength; i++) {
    let key = keys[i];
    let val = longOptions[key];

    if (PARAM_EXPANSION[key]) {
      key = PARAM_EXPANSION[key];
    } else {
      key = encodeURIComponent(key);
    }

    if (key.substr(-2) === "64") {
      val = Base64.encodeURI(val);
    }

    url += key + "=" + encodeURIComponent(val) + "&";
  }

  return url.slice(0, -1);
}
github RocketChat / Rocket.Chat.ReactNative / app / views / LoginSignupView.js View on Github external
getOAuthState = () => {
		const credentialToken = random(43);
		return Base64.encodeURI(JSON.stringify({ loginStyle: 'popup', credentialToken, isCordova: true }));
	}
github vmurin / react-native-azure-auth / src / token / baseTokenItem.js View on Github external
static createAccessTokenKey(clientId, userId, scope) {
        return Base64.encodeURI(clientId) +
            TOKEN_CACHE_KEY_DELIMITER +
            Base64.encodeURI(normalizeId(userId)) +
            TOKEN_CACHE_KEY_DELIMITER +
            Base64.encodeURI(scope.toString())
    }
github mixer / webpack-bundle-compare / src / client / components / util.ts View on Github external
export const linkToNodeModule = (name: string) => `/dashboard/nodemodule/${Base64.encodeURI(name)}`;
github mixer / webpack-bundle-compare / src / client / components / util.ts View on Github external
export const linkToModule = (identifier: string) =>
  `/dashboard/ownmodule/${Base64.encodeURI(identifier)}`;
github mixer / webpack-bundle-compare / src / client / components / graphs / graph-tool.tsx View on Github external
while (queue.length > 0) {
    const { node, depth } = queue.pop()!;
    if (depth > maxDepth) {
      needsFiltering = true;
      break;
    }

    if (--limit === 0) {
      needsFiltering = true;
      break;
    }

    const sourceEncoded = Base64.encodeURI(node.name);
    for (const found of getReasonsFn(node)) {
      const foundEncoded = Base64.encodeURI(found.name);

      if (!sources.has(found.name)) {
        sources.add(found.name);
        queue.push({ node: found, depth: depth + 1 });
      }

      edges.push({
        data: {
          id: `edge${sourceEncoded}to${foundEncoded}`,
          source: sourceEncoded,
          target: foundEncoded,
        },
      });
    }

    nodes.push({