Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed8d621d9a | ||
|
|
9a43493ca7 | ||
|
|
8677934d48 |
@@ -1 +1 @@
|
|||||||
0.6.0: QmXUuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z
|
0.7.0: QmbTGYCo96Z9hiG37D9zeErFo5GjrEPcqdh7PJX1HTM73E
|
||||||
|
|||||||
4
cid.go
4
cid.go
@@ -16,6 +16,10 @@ const (
|
|||||||
CBOR = 0x71
|
CBOR = 0x71
|
||||||
Raw = 0x72
|
Raw = 0x72
|
||||||
JSON = 0x73
|
JSON = 0x73
|
||||||
|
|
||||||
|
EthereumBlock = 0x90
|
||||||
|
EthereumTx = 0x91
|
||||||
|
Bitcoin = 0xb0
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCidV0(h mh.Multihash) *Cid {
|
func NewCidV0(h mh.Multihash) *Cid {
|
||||||
|
|||||||
10
cid_test.go
10
cid_test.go
@@ -2,6 +2,7 @@ package cid
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"math/rand"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
mh "github.com/multiformats/go-multihash"
|
mh "github.com/multiformats/go-multihash"
|
||||||
@@ -108,3 +109,12 @@ func TestPrefixRoundtrip(t *testing.T) {
|
|||||||
t.Fatal("input prefix didnt match output")
|
t.Fatal("input prefix didnt match output")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestFuzzCid(t *testing.T) {
|
||||||
|
buf := make([]byte, 128)
|
||||||
|
for i := 0; i < 200; i++ {
|
||||||
|
s := rand.Intn(128)
|
||||||
|
rand.Read(buf[:s])
|
||||||
|
_, _ = Cast(buf[:s])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,6 @@
|
|||||||
"license": "",
|
"license": "",
|
||||||
"name": "go-cid",
|
"name": "go-cid",
|
||||||
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
|
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
|
||||||
"version": "0.6.0"
|
"version": "0.7.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user