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

Fix decoding error for strings with leading 1's #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

a2hill
Copy link

@a2hill a2hill commented Dec 24, 2020

The current implementation improperly decodes Base58 strings with leading 1's (see #18 ). As a result base58CheckDecode fails. I've fixed the decoding implementation and added two tests. One to verify that base58CheckDecode works for strings with leading 1's and another to verify that a string with all 1's will decode correctly.

@codecov-io
Copy link

Codecov Report

Merging #21 (06f76eb) into master (1c13ea6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #21   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           50        53    +3     
=========================================
+ Hits            50        53    +3     
Impacted Files Coverage Δ
Base58Swift/Base58.swift 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c13ea6...06f76eb. Read the comment docs.

@heckj
Copy link

heckj commented May 23, 2024

@keefertaylor I just hit this issue (#18, #23, #25) and it looks like this PR may resolve it. Any chance you could look it over, potentially merging and releasing an update so that BS58Swift encodes and decodes more consistently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants