From 41fc6044aa4b98d69e412486d78b6a9370a90123 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 18 May 2023 14:15:04 +0200 Subject: [PATCH] chore: deprecate types and readme --- README.md | 7 +++++++ validate.go | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..71b2367 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +## ❗ This repo is no longer maintained. +👉 We highly recommend switching to the maintained version at https://github.com/ipfs/boxo/tree/main/verifcid. +🏎️ Good news! There is [tooling and documentation](https://github.com/ipfs/boxo#migrating-to-boxo) to expedite a switch in your repo. + +⚠️ If you continue using this repo, please note that security fixes will not be provided (unless someone steps in to maintain it). + +📚 Learn more, including how to take the maintainership mantle or ask questions, [here](https://github.com/ipfs/boxo/wiki/Copied-or-Migrated-Repos-FAQ). diff --git a/validate.go b/validate.go index 9164d6d..b3cef84 100644 --- a/validate.go +++ b/validate.go @@ -7,8 +7,13 @@ import ( mh "github.com/multiformats/go-multihash" ) +// Deprecated: use github.com/ipfs/boxo/verifcid.ErrPossiblyInsecureHashFunction var ErrPossiblyInsecureHashFunction = fmt.Errorf("potentially insecure hash functions not allowed") + +// Deprecated: use github.com/ipfs/boxo/verifcid.ErrBelowMinimumHashLength var ErrBelowMinimumHashLength = fmt.Errorf("hashes must be at least %d bytes long", minimumHashLength) + +// Deprecated: use github.com/ipfs/boxo/verifcid.ErrAboveMaximumHashLength var ErrAboveMaximumHashLength = fmt.Errorf("hashes must be at most %d bytes long", maximumHashLength) const minimumHashLength = 20 @@ -36,6 +41,7 @@ var goodset = map[uint64]bool{ mh.SHA1: true, // not really secure but still useful } +// Deprecated: use github.com/ipfs/boxo/verifcid.IsGoodHash func IsGoodHash(code uint64) bool { good, found := goodset[code] if good { @@ -54,6 +60,7 @@ func IsGoodHash(code uint64) bool { return false } +// Deprecated: use github.com/ipfs/boxo/verifcid.ValidateCid func ValidateCid(c cid.Cid) error { pref := c.Prefix() if !IsGoodHash(pref.MhType) {