If I have a file, and I want to see if it is present on IPFS, is there some obvious way to compute its hash then see if a file is returned from the a url including that hash?
If I have a file, and I want to see if it is present on IPFS, is there some obvious way to compute its hash then see if a file is returned from the a url including that hash?
You can check out how a CID is created from a file here or check out libraries for your languages such as this one for Rust to encode your file into a CID and compare it with those retrieved from IPFS.
Note that CID is not the same as a file's hash. CID is derived from a process called multihash and encoded in base-58 encoding. If you have a hash of a file (like sha-256 or keccak256) that isn't CID and you don't know the file, then it is not possible to retrieve the file from IPFS since the hash or checksum is only useful for validating the file, but not possible to retrieve the file content.
See also: CID decoding algorithm