Is it possible to check the given ipfs-hash is valid or not?

Based on the creating ipfs hash algorithm(https://ethereum.stackexchange.com/a/53233/4575), how can I check the given ipfs-hash is valid or not?

You can check at https://cid.ipfs.io/

I was looking for a Python tool or function to check it given Qm string is valid or not, basaed on its size, valid characters etc.

Like this one? https://github.com/ipld/py-cid

1 Like

Thanks @hector

Following solves it:

from cid import make_cid
make_cid('QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4')