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
dms3
go-cidutil
Commits
06d2604d
Commit
06d2604d
authored
Jul 26, 2018
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use lookup table in go-multibase now that it is supported.
parent
b2038702
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
cid-fmt/main.go
cid-fmt/main.go
+3
-5
No files found.
cid-fmt/main.go
View file @
06d2604d
...
...
@@ -228,13 +228,11 @@ func fmtCid(fmtStr string, base mb.Encoding, cid *c.Cid) (string, error) {
}
func
baseToString
(
base
mb
.
Encoding
)
string
{
// FIXME: Use lookup tables when they are added to go-multibase
switch
base
{
case
mb
.
Base58BTC
:
return
"base58btc"
default
:
baseStr
,
ok
:=
mb
.
EncodingToStr
[
base
]
if
!
ok
{
return
fmt
.
Sprintf
(
"base?%c"
,
base
)
}
return
baseStr
}
func
codecToString
(
num
uint64
)
string
{
...
...
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