You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It validates that the CID is at least 32 bytes long, that's it.
It doesn't even look at the codec, length, or multihash-code.
It doesn't support or even check if the CID has an unexpected digest length (CIDs support more than 32-byte digests).
From what I can tell, the "CIDs" here are all piece CIDs. I'd just store the digests. Saves space/gas anyways!
If we absolutely need to store them as CIDs, we should change this library to be PieceCid and have it check that the prefix matches a specific prefix and that the CID is of the expected length.
Alternatively, if you're worried about changing the state (even though you'd definitely save gas), change it to a generic slice manipulation library for adding/removing prefixes. That way, at the very least, nobody will be confused and think that this library actually handles CIDs in a sane way.
As far as I can tell, this project could just use raw hashes. I ask because this library:
IMO, it would be better to just use raw hashes.
The text was updated successfully, but these errors were encountered: