multiformats 1.4.0
multiformats: ^1.4.0 copied to clipboard
Core library for parsing IPFS-related things. This package is mainly used by https://atprotodart.com packages.
Release Note #
1.4.0 #
- fix:
dagCborEncodekeeps its documentedArgumentError/InvalidCidErrorcontract for a sole-$bytesmap whose value is not valid base64, which previously leaked a rawFormatException— reachable from user-supplied$unknowndata. - fix: a sole-
$linkor sole-$bytesmap whose value is not aStringnow throwsArgumentErrorinstead of being silently encoded as an ordinary one-entry map, which turned a typo into a valid-looking but wrong CID. - fix: encoding a value nested deeper than 1024 containers throws
ArgumentErrorinstead of blowing the stack with aStackOverflowErrorthat callers do not catch.
1.3.0 #
- feat: added
dagCborEncode, a canonical DAG-CBOR encoder (length-first map-key ordering, minimal-length integers, tag-42 CID links, and the atproto$link/$bytesmap forms). Its output is exact on both the Dart VM and the web, so a record's bytes — and therefore its CID — can be computed locally.
1.2.0 #
- feat:
CID.toAtprotoJson()emits the atproto data-model{$link: ...}form (toJsoncontinues to emit DAG-JSON{/: ...};fromJsonaccepts both). - fix: the
bytesgetter returns an unmodifiable view, so external mutation can no longer corrupt aCIDor desync its cachedhashCode. - fix:
CID.parserejects uppercase base32 bodies, and invalid base32 characters raiseInvalidCidErrorinstead of a rawFormatException.
1.1.0 #
- fix: the
dag-pbmulticodec was wrong (0x55, which is actuallyraw). Added correctraw(0x55),dagPb2(0x70)anddagCbor(0x71)entries and fixedisDagPb/format checks so atproto blob CIDs are classified correctly and realdag-pbis no longer rejected. - chore: deprecated the incorrect
dagPb/dabCborenum values (kept for a deprecation cycle). - feat: added
CID.createFromBytes(binary overload) and a single-decodeparse. - feat:
CID.fromJsonnow accepts the atproto{"$link": <cid>}shape in addition to the DAG-JSON{"/": <cid>}shape, so atproto JSON round-trips (toJsonstill emits/). A missing/non-string value now throws a typedInvalidCidErrorinstead of aTypeError. - perf: cache normalized
bytesandhashCodeinstead of recomputing on every access.
1.0.3 #
- fix:
CID ==now returnsfalsefor different-length or non-CIDoperands instead of throwing aRangeError/TypeError.
1.0.2 #
- Fix SDK constraint to '">=3.8.0 <4.0.0"'.
1.0.1 #
- chore: optimized docs.
1.0.0 #
- Bump SDK constraint to '^3.8.0'.
0.2.3 #
- Bump SDK constraint to '^3.3.0'.
0.2.0 #
- Drop support for null unsafe Dart, bump SDK constraint to '^3.0.0'. (#599)
- Dart3 modifier applied.
0.1.3 #
- Improved generation of
CIDhash codes, allowing CID objects to be specified as keys for Maps, etc. (#490)
0.1.0 #
0.0.1 #
- First Release.