Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
460554fb6e | ||
|
|
5d17ab8c70 | ||
|
|
ed8d621d9a | ||
|
|
9a43493ca7 | ||
|
|
8677934d48 |
@@ -1 +1 @@
|
||||
0.6.0: QmXUuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z
|
||||
0.7.2: QmPBa9N9MuZ16fPuKMv9KCq1aAwhkTY4G6LXQYQmWJiCrj
|
||||
|
||||
5
cid.go
5
cid.go
@@ -16,6 +16,11 @@ const (
|
||||
CBOR = 0x71
|
||||
Raw = 0x72
|
||||
JSON = 0x73
|
||||
|
||||
EthereumBlock = 0x90
|
||||
EthereumTx = 0x91
|
||||
BitcoinBlock = 0xb0
|
||||
BitcoinTx = 0xb1
|
||||
)
|
||||
|
||||
func NewCidV0(h mh.Multihash) *Cid {
|
||||
|
||||
10
cid_test.go
10
cid_test.go
@@ -2,6 +2,7 @@ package cid
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
mh "github.com/multiformats/go-multihash"
|
||||
@@ -108,3 +109,12 @@ func TestPrefixRoundtrip(t *testing.T) {
|
||||
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": "",
|
||||
"name": "go-cid",
|
||||
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
|
||||
"version": "0.6.0"
|
||||
"version": "0.7.2"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user