craftzdog / craftzdog/react-native-quick-base64

toBase64 results differ from js-base64

Open
#3 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
464
Forks
40
PR merge metrics
No merged PRs in 30d

Description

I have run the same byte arrays through js-base64 and cpp64 with those results:

 LOG  [82, 235, 19, 104, 164, 2, 214, 83, 201, 109, 220, 113, 198, 127, 246, 41, 43, 88, 224, 70, 83, 8, 70, 37, 84, 13, 192, 247, 128, 225, 4, 94]
 LOG  cpp64: UusTaKQC1lPJbdxxxn/2KStY4EZTCEYlVA3A94DhBF4=
 LOG  jsb64: UusTaKQC1lPJbdxxxn/2KStY4EZTCEYlVA3A94DhBF4=
 LOG  [11, 80, 135, 209, 171, 28, 64, 255, 39, 210, 24, 201, 226, 41, 153, 223, 120, 249, 81, 218, 135, 69, 207, 111]
 LOG  cpp64: C1CH0ascQP8n0hjJ4imZ33j5UdqHRc9v
 LOG  jsb64: C1CH0ascQP8n0hjJ4imZ33j5UdqHRc9v
 LOG  [184, 179, 212, 210, 19, 142, 29, 203, 166, 118, 216, 245, 113, 162, 222, 115]
 LOG  cpp64: AAAAAAAAAAAAAAAAAAAAALiz1NITjh3LpnbY9XGi3nM=
 LOG  jsb64: uLPU0hOOHcumdtj1caLecw==

The A padding on the last tuple is wrong..

Any idea what could be wrong?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the toBase64 entry point and reproduce the third byte-array example, comparing cpp64 with js-base64. The fix is complete when the third result no longer contains the incorrect A padding and the other reported examples still match.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.