Compare commits

..

3 Commits

Author SHA1 Message Date
Jeromy
ed8d621d9a gx publish 0.7.0 2016-10-19 17:54:06 -07:00
Jeromy
9a43493ca7 add codes for bitcoin and ethereum 2016-10-19 17:53:39 -07:00
Jeromy
8677934d48 add small test to fuzz cid creation routines 2016-10-09 12:19:14 -07:00
4 changed files with 16 additions and 2 deletions

View File

@@ -1 +1 @@
0.6.0: QmXUuRadqDq5BuFWzVU6VuKaSjTcNm1gNCtLvvP1TJCW4z
0.7.0: QmbTGYCo96Z9hiG37D9zeErFo5GjrEPcqdh7PJX1HTM73E

4
cid.go
View File

@@ -16,6 +16,10 @@ const (
CBOR = 0x71
Raw = 0x72
JSON = 0x73
EthereumBlock = 0x90
EthereumTx = 0x91
Bitcoin = 0xb0
)
func NewCidV0(h mh.Multihash) *Cid {

View File

@@ -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])
}
}

View File

@@ -25,6 +25,6 @@
"license": "",
"name": "go-cid",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "0.6.0"
"version": "0.7.0"
}