Skip to content

Support for base64url format #26512

@yvele

Description

@yvele

new Buffer(str, "base64") officially accepts both RFC 3548 (+,/) encoding as well as RFC 4648 (-,_) encoding (see #5239 and #5243).

To base64 encode a buffer using RFC 3548 we can actually do buffer.toString("base64").

Would it be possible to also natively support RFC 4648 format using buffer.toString("base64url") ?

If yes, should we strip trailing = characters as they are unnecessary and potentially harmful used in an URL?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions