Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

base64 to base64url

/**
 * Function that converts a base64 string into a base64url string
 * @param {string} input - The string to convert
 */
function base64ToBase64url(input) {
  // Replace non-url compatible chars with base64url standard chars and remove leading =
  return input
    .replace(/+/g, '_')
    .replace(///g, '-')
    .replace(/=+$/g, '');
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: repeat pattern regex 
Javascript :: array indexof 
Javascript :: react native basic template 
Javascript :: promise async await 
Javascript :: js listen websocket 
Javascript :: longest word in a string 
Javascript :: how to stop angular server 
Javascript :: hasownproperty.call 
Javascript :: json to csv 
Javascript :: component will mount hooks 
Javascript :: jquery modal 
Javascript :: Modify String with Uppercase 
Javascript :: javascript Arrow Function with No Argument 
Javascript :: nested json array 
Javascript :: buffer concat nodejs 
Javascript :: js push multiple arguments 
Javascript :: react-bootstrap sidebar menu 
Javascript :: get last element from array javascript 
Javascript :: js keycodes 
Javascript :: slice js 
Javascript :: how use multi things in in switch case in js 
Javascript :: getattribute 
Javascript :: Check If Object Contains A Function 
Javascript :: react native image border radius not working 
Javascript :: angular input decimal pipe 
Javascript :: js repeat 
Javascript :: remove two things from javascript string 
Javascript :: generator js 
Javascript :: understanding currying 
Javascript :: javascript number 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =