How to use 'urldecode javascript' in JavaScript

Every line of 'urldecode javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
7export function base64UrlDecode(str: string): Uint8Array {
8 let temp = Base64.decode(this.replace(/-/g, '+').replace(/_/g, '/'));
9 let arr = new Uint8Array(temp.length);
10 for (let i = 0; i < str.length; i++)
11 arr[i] = str.charCodeAt(i);
12 return arr;

Use secure code every time

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

10export function base64UrlDecode(str: string): string {
11 return base64Decode(str.replace(/-/g, '+').replace(/_/g, '/'))

Related snippets