Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement base64url in Buffer #462

Open
huseeiin opened this issue Feb 14, 2025 · 2 comments · May be fixed by #471
Open

implement base64url in Buffer #462

huseeiin opened this issue Feb 14, 2025 · 2 comments · May be fixed by #471
Labels
enhancement New feature or request

Comments

@huseeiin
Copy link

Environment

latest node and unenv

Reproduction

Buffer.from('hello').toString('base64url')

Describe the bug

base64url is not implemented

Additional context

base64url is just base64.replaceAll("+", "-").replaceAll("/", "_").replace("==", "")

there's feross/buffer#314 but the author is not proving it

Logs

@huseeiin huseeiin added the bug Something isn't working label Feb 14, 2025
@huseeiin
Copy link
Author

you can also use deno's browser-compatible polyfills for node.js builtins: https://deno.land/[email protected]/node/internal/buffer.mjs?source

@pi0 pi0 added enhancement New feature or request and removed bug Something isn't working labels Feb 17, 2025
@pi0
Copy link
Member

pi0 commented Feb 17, 2025

Do you mind to drop a PR?

Deno implementation is good, you can use this also I converted it to b64url only + small changes.

huseeiin added a commit to huseeiin/unenv that referenced this issue Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants