1 2 3 4 5 6 7 8 9 10 11 12 13
function base64UrlSafe(hashString = "") { return hashString.replace(/[=\+\/]/g, function(match) { if(match === "=") { return ""; } if(match === "+") { return "-"; } return "_"; }); } module.exports = { base64UrlSafe };