Skip to content

Base64 Decode requires padding #37

@scholtes

Description

@scholtes

Base64 Decode will not decode strings with the padding characters removed.

As the padding characters are technically not required to decode without ambiguity, many applications strip the padding after encoding.

A quick fix would be to change the following line (here):

return base64.b64decode(text).decode('raw_unicode_escape')

to this:

return base64.b64decode(text + '===').decode('raw_unicode_escape')

(Per this gist, excess padding is safely ignored. More tips and tricks in that link).

A Sublime user can work around this by manually typing in the padding before using this feature, but I think adding this redundancy could benefit the overall ease of use (and hopefully not break anyone's workflow).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions