Skip to content

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

@Reranko05

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++

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions