Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Allow ll-specific multihash #1

Merged
merged 5 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/ipfs/go-verifcid

go 1.15

require (
github.com/ipfs/go-cid v0.0.1
github.com/multiformats/go-multihash v0.0.1
Expand Down
6 changes: 4 additions & 2 deletions validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ func IsGoodHash(code uint64) bool {
return true
}
}

return false
// XXX: This has to be on par with what the LazyLedger IPLD plugin registers as a multihash
// namely, Sha256Namespace8Flagged. We simply repeat the constant here instead of
// importing the corresponding package from lazyledger-core as this would be overkill.
return code == 0x7701
}

func ValidateCid(c cid.Cid) error {
Expand Down