Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mf
go-multiaddr
Commits
ae5c4f83
Commit
ae5c4f83
authored
Apr 05, 2019
by
idk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix how the padding is computed
parent
946a6f66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
transcoders.go
transcoders.go
+5
-9
No files found.
transcoders.go
View file @
ae5c4f83
...
...
@@ -261,18 +261,14 @@ func garlic32StB(s string) ([]byte, error) {
return
nil
,
fmt
.
Errorf
(
"failed to parse garlic addr: %s not a i2p base32 address. len: %d"
,
s
,
len
(
s
))
}
}
for
len
(
s
)
<
56
{
//compute the length to pad the address to, usually 56 or 64
x
:=
int
((
len
(
s
)
/
8
)
+
1
)
*
8
for
len
(
s
)
<
x
{
s
+=
"="
}
garlicHostBytes
,
err
:=
garlicBase32Encoding
.
DecodeString
(
s
)
garlicHostBytes
,
err
:=
garlicBase32Encoding
.
DecodeString
(
s
[
0
:
56
])
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to decode base32 garlic addr: %s, err: %v len: %v"
,
s
,
err
,
len
(
s
),
)
return
nil
,
fmt
.
Errorf
(
"failed to decode base32 garlic addr: %s, err: %v len: %v"
,
s
,
err
,
len
(
s
))
}
return
garlicHostBytes
,
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment