Skip to content

Commit

Permalink
Merge pull request #125 from multiformats/fix/varint-msb
Browse files Browse the repository at this point in the history
fix: varints are msb
  • Loading branch information
Stebalien committed Feb 4, 2020
2 parents 1463ed8 + f7319ab commit 6b39927
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require (
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771
github.com/mr-tron/base58 v1.1.3
github.com/multiformats/go-varint v0.0.4
github.com/multiformats/go-varint v0.0.5
github.com/spaolacci/murmur3 v1.1.0
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
)
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/multiformats/go-varint v0.0.3 h1:1OZFaq4XbSNQE6ujqgr6/EIZlgHE7DmojAFs
github.com/multiformats/go-varint v0.0.3/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiformats/go-varint v0.0.4 h1:CplQWhUouUgTZ53vNFE8VoWr2VjaKXci+xyrKyyFuSw=
github.com/multiformats/go-varint v0.0.4/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiformats/go-varint v0.0.5 h1:XVZwSo04Cs3j/jS0uAEPpT3JY6DzMcVLLoWOSnCxOjg=
github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down
7 changes: 6 additions & 1 deletion multihash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,12 @@ func TestBadVarint(t *testing.T) {
t.Error("expected error from cut-off varint, got: ", err)
}

_, err = Cast([]byte{128, 1})
_, err = Cast([]byte{129, 0})
if err != varint.ErrNotMinimal {
t.Error("expected error non-minimal varint, got: ", err)
}

_, err = Cast([]byte{128, 0})
if err != varint.ErrNotMinimal {
t.Error("expected error non-minimal varint, got: ", err)
}
Expand Down

0 comments on commit 6b39927

Please sign in to comment.