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-cid
Commits
de498491
Commit
de498491
authored
Sep 12, 2020
by
Alex Good
Committed by
Rod Vagg
Oct 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the dagjose multiformat
parent
8b9ff390
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
cid.go
cid.go
+3
-0
cid_test.go
cid_test.go
+1
-0
No files found.
cid.go
View file @
de498491
...
...
@@ -58,6 +58,7 @@ const (
GitRaw
=
0x78
DagJOSE
=
0x85
EthBlock
=
0x90
EthBlockList
=
0x91
EthTxTrie
=
0x92
...
...
@@ -106,6 +107,7 @@ var Codecs = map[string]uint64{
"dash-tx"
:
DashTx
,
"fil-commitment-unsealed"
:
FilCommitmentUnsealed
,
"fil-commitment-sealed"
:
FilCommitmentSealed
,
"dag-jose"
:
DagJOSE
,
}
// CodecToStr maps the numeric codec to its name
...
...
@@ -133,6 +135,7 @@ var CodecToStr = map[uint64]string{
DashTx
:
"dash-tx"
,
FilCommitmentUnsealed
:
"fil-commitment-unsealed"
,
FilCommitmentSealed
:
"fil-commitment-sealed"
,
DagJOSE
:
"dag-jose"
,
}
// tryNewCidV0 tries to convert a multihash into a CIDv0 CID and returns an
...
...
cid_test.go
View file @
de498491
...
...
@@ -40,6 +40,7 @@ var tCodecs = map[uint64]string{
DashTx
:
"dash-tx"
,
FilCommitmentUnsealed
:
"fil-commitment-unsealed"
,
FilCommitmentSealed
:
"fil-commitment-sealed"
,
DagJOSE
:
"dag-jose"
,
}
func
assertEqual
(
t
*
testing
.
T
,
a
,
b
Cid
)
{
...
...
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