Conversation
|
I also need base64url encoding support for my project, |
|
Any news for this ? Please. |
|
same issue, any news? |
|
Thanks for coding this, @jrschumacher! Using it for a fork |
|
I need base64url encoding support for my project, can we review and merge this ASAP? |
|
It's probably not going to happen if it's been this long. Just use my branch or just wrap the base64 function in a string replace. |
|
Hopefully this is merged some day. It seems to work well |
|
@dcousens I removed trailing spaces on line 955 of index.js |
|
@dcousens still interested in taking this? |
Using string replaceAll since base64 is external base64-js. Dependency does not yet support base64url beatgammit/base64-js#53
4da50f9 to
f22ba44
Compare
|
I rebased with the master branch and removed my lint scripts from the package.json to reduce conflicts. |
|
Thanks @jrschumacher, I'm happy to take this from here next I can, I need to check in on @chjj's pull request in #349, which might supersede this |
|
Would it be possible to merge and release this first since the other PR seems stuck for a long time now? |
|
If the goal is to make it behave like Node.js, we also need to strip and add the padding. function base64urlToBase64 (str) {
// Replace '-' back to '+' and '_' back to '/'
let base64 = str
.replaceAll(BASE64URL_CHAR_62, BASE64_CHAR_62)
.replaceAll(BASE64URL_CHAR_63, BASE64_CHAR_63)
// Add padding ('=') if needed
const padding = base64.length % 4
if (padding > 0) {
base64 += '='.repeat(4 - padding)
}
return base64;
}
function base64urlFromBase64 (str) {
return str
.replaceAll(BASE64_CHAR_62, BASE64URL_CHAR_62)
.replaceAll(BASE64_CHAR_63, BASE64URL_CHAR_63)
.replace(/=+$/, '')
} |
|
@SamVerschueren given that this will be 3 years old this month, I'm going to close it since there doesn't seem any intention to move forward with it. |
|
@SamVerschueren you might want to consider adding a PR to https://github.com/feross/base64-js |
|
Yeah agreed. In the mean time I created my own fork to fix the issue. Just wanted to post it as additional information for people running into the same issue. |
Using string replaceAll since base64 is external base64-js.
Dependency does not yet support base64url beatgammit/base64-js#53