13 lines
237 B
JavaScript
13 lines
237 B
JavaScript
function base64UrlSafe(hashString = "") {
|
|
return hashString.replace(/[=\+\/]/g, function(match) {
|
|
if(match === "=") {
|
|
return "";
|
|
}
|
|
if(match === "+") {
|
|
return "-";
|
|
}
|
|
return "_";
|
|
});
|
|
}
|
|
|
|
module.exports = { base64UrlSafe }; |