Expand description
The cid string format: a content identifier, checked by shape only.
This project emits no CIDs at all — didbot-pds’s RecordStore::put says why —
so the only CIDs it will ever see are ones a client wrote into a record.
The check is therefore the lenient one atproto specifies: an ASCII string
of plausible length in the multibase alphabets, not a decode. Decoding
would mean a multibase and multihash implementation for a value nothing
here dereferences.
One version rule is enforced rather than left to shape. CIDv0 — 46
characters of base58 opening with Qm — is a valid IPFS identifier and is
not permitted in atproto, and it passes every length and alphabet test, so
nothing but naming it would catch it.
Enums§
- CidError
- Why a string is not a usable CID.
Constants§
- CID_
V0_ 🔒LENGTH - How long a CIDv0 is:
Qmplus a base58-encoded 32-byte multihash. - MAX_
CID_ LENGTH - Longest a CID may be.
- MIN_
CID_ LENGTH - Shortest a CID may be.
Functions§
- validate
- Checks a string against the lenient CID rules.