I have been searching forever but somehow I am never really getting where I want to be.
I simply want to use the contents of a file + filename to calculate the CID but with plain code and not with any other library. None of the IPFS CLI commands seem to be able to give me sets of data that I can transform to bytes(either from hex or base58) that will match the CID(ofcourse 1220) if I sha256 it.
999999999999999999999999999999999999999999999999999999999999999900000000000000000000000000000000 with filename
What should I do eventually get to CID:
The reason I want from content to CID is that I eventually want to be able to validate small files in solidity and perform file format checks. So I want to be able to calculate the CID FROM only it’s contents. Eventually I want to reconstruct a top level folder as well, but that is a problem I think I can solve if I can get to a CID from content only.
Really hope someone can help, because I am a bit lost here, the best I got so far is to manually construct some protobuff file and handle the varint etc (Note that I want to do this in solidity)