multiformats 1.4.0 copy "multiformats: ^1.4.0" to clipboard
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: dagCborEncode keeps its documented ArgumentError/InvalidCidError contract for a sole-$bytes map whose value is not valid base64, which previously leaked a raw FormatException — reachable from user-supplied $unknown data.
  • fix: a sole-$link or sole-$bytes map whose value is not a String now throws ArgumentError instead 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 ArgumentError instead of blowing the stack with a StackOverflowError that 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/$bytes map 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 (toJson continues to emit DAG-JSON {/: ...}; fromJson accepts both).
  • fix: the bytes getter returns an unmodifiable view, so external mutation can no longer corrupt a CID or desync its cached hashCode.
  • fix: CID.parse rejects uppercase base32 bodies, and invalid base32 characters raise InvalidCidError instead of a raw FormatException.

1.1.0 #

  • fix: the dag-pb multicodec was wrong (0x55, which is actually raw). Added correct raw(0x55), dagPb2(0x70) and dagCbor(0x71) entries and fixed isDagPb/format checks so atproto blob CIDs are classified correctly and real dag-pb is no longer rejected.
  • chore: deprecated the incorrect dagPb/dabCbor enum values (kept for a deprecation cycle).
  • feat: added CID.createFromBytes (binary overload) and a single-decode parse.
  • feat: CID.fromJson now accepts the atproto {"$link": <cid>} shape in addition to the DAG-JSON {"/": <cid>} shape, so atproto JSON round-trips (toJson still emits /). A missing/non-string value now throws a typed InvalidCidError instead of a TypeError.
  • perf: cache normalized bytes and hashCode instead of recomputing on every access.

1.0.3 #

  • fix: CID == now returns false for different-length or non-CID operands instead of throwing a RangeError/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.2 #

  • Very minor change. (#1112)

0.2.1 #

  • Improved documents. (#677)

0.2.0 #

  • Drop support for null unsafe Dart, bump SDK constraint to '^3.0.0'. (#599)
  • Dart3 modifier applied.

0.1.4 #

  • Added homepage in pubspec.yaml. (#549)

0.1.3 #

  • Improved generation of CID hash codes, allowing CID objects to be specified as keys for Maps, etc. (#490)

0.1.2 #

  • Supported dag-cbor. (#484)

0.1.1 #

  • Fixed a bug in CID. (#482)

0.1.0 #

  • Added CID.create factory. Now you can create CID from specific text. (#477)
  • Added validation in CID.parse factory. (#479)

0.0.1 #

  • First Release.
2
likes
160
points
4.79k
downloads

Documentation

API reference

Publisher

verified publisheratprotodart.com

Weekly Downloads

Core library for parsing IPFS-related things. This package is mainly used by https://atprotodart.com packages.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#ipfs #atproto #bluesky #cid

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (license)

Dependencies

base_codecs, crypto, dart_multihash

More

Packages that depend on multiformats