Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.74.1] Cherry-pick Hermes atob padding fix #287

Closed
hirbod opened this issue May 9, 2024 · 1 comment
Closed

[0.74.1] Cherry-pick Hermes atob padding fix #287

hirbod opened this issue May 9, 2024 · 1 comment
Labels
Type Pick Request Pick requests to include commits inside a React Native release

Comments

@hirbod
Copy link

hirbod commented May 9, 2024

Target Branch(es)

0.74

Link to commit or PR to be picked

facebook/hermes#1379

Description

base64 decoding fails if the provided string does not contain padding. This is breaking our app.
As a workaround I added following function to add padding before trying to decode.

function ensureBase64Padding(base64: string) {
    const paddingNeeded = (4 - base64.length % 4) % 4;
    return base64 + '='.repeat(paddingNeeded);
}

Kindly asking to cherry-pick this fix.

@cipolleschi
Copy link
Collaborator

Picked ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type Pick Request Pick requests to include commits inside a React Native release
Projects
No open projects
Status: Done / Picked
Development

No branches or pull requests

2 participants