Skip to content

Allow passing in byte buffer like structures to main/encoding/base64.decodeBase64 #6489

@elee1766

Description

@elee1766

Is your feature request related to a problem? Please describe.

I would like to use decodeBase64, but my base64 text is already in a uint8array. I would like to avoid having to copy my uint8array to a string, just so it can be parsed to a uint8array by TextEncoder.encode() in decodeBase64

Describe the solution you'd like

just like how encodeBase64(data: ArrayBuffer | Uint8Array | string): string accepts multiple datatypes, decodeBase64 should perhaps do the same, ala decodeBase64(data: ArrayBuffer | Uint8Array | string): Uint8Array_. can do the same type switching that encodeBase64 does, and skip the textencoder.encode

Describe alternatives you've considered

i could copy the code out of base64.ts and make my own version that accepts both types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions