Skip to content

Commit 4fea96c

Browse files
authored
Merge pull request #2 from BenWestgate/BenWestgate-patch-1
2 parents bc4506c + 7beef6f commit 4fea96c

File tree

1 file changed

+1
-3
lines changed
  • reference/python-codex32/src

1 file changed

+1
-3
lines changed

reference/python-codex32/src/lib.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,9 @@ def ms32_decode(ms32_str):
167167
return None, None, None, None, None
168168
hrp = ms32_str[:pos]
169169
k = ms32_str[pos + 1]
170-
if not k.isdigit():
171-
return None, None, None, None, None
172170
ident = ms32_str[pos + 2: pos + 6]
173171
share_index = ms32_str[pos + 6]
174-
if k == "0" and share_index != "s":
172+
if not k.isdigit() or k == "0" and share_index != "s":
175173
return None, None, None, None, None
176174
data = [CHARSET.find(x) for x in ms32_str[pos + 1:]]
177175
checksum_length = 13 if len(data) < 95 else 15

0 commit comments

Comments
 (0)