Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

That function isIpfs conflates matching URI fragments and checking if the hash is a CID makes it less useful #52

Closed
TimDaub opened this issue Sep 6, 2022 · 1 comment

Comments

@TimDaub
Copy link

TimDaub commented Sep 6, 2022

  • @neume-network we're dealing with many different formatted ipfs URIs ranging from all the sorts you're handling in your library
  • It's already useful that there is a library that can determine if something is an ipfs link or not, so that's great
  • but additionally, if we were able to extract a valid CID from that link it'd be even better
  • Sadly though, instead of returning the raw hash itself as the match for a CID, isIpfs returns a boolean as a result of isCID and so: Yes we know that something is an ipfs link but not which fragment is the hash:
    return isCID(hash)
  • So potentially it'd make sense having a function determine that a link is a valid ipfs link
  • and then another function potentially matching and allowing the user to retrieve the hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant