Skip to content

[C++] Optimize base64_decode validation using lookup table #49720

Description

@Reranko05

Describe the enhancement requested

The current implementation of base64_decode validates characters using base64_chars.find() per byte, which results in repeated linear searches.

This can be optimized by using a 256-entry lookup table (byte → sextet or invalid marker), allowing validation and decoding in a single pass with O(1) lookup.

This was identified during PR review and deferred to a follow-up.

Related: #49660

Component(s)

C++

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions