/**
 * @description Converts a string to a base64url encoded string.
 * @param str
 * @returns {string}
 */
const base64UrlEncode = (str) =>
  Buffer.from(str).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");

module.exports = base64UrlEncode;
