Skip to content

Support indefinite length bytestring - #371

Open
qnikst wants to merge 1 commit into
well-typed:masterfrom
tweag:infinite-bignum
Open

qnikst wants to merge 1 commit into
well-typed:masterfrom
tweag:infinite-bignum

Conversation

@qnikst

@qnikst qnikst commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

We support indefinite length bytestring in the Read module.

In order to do it we add two extra variants for bigint deseralization, both puts us to the slow-path to start consumption of the chunks.

This serialization is considered non-canonical thus canonical read rejects is. While specification is silent about it, the cbor.me implementation always converts bigit into a fixed size byte blob.

Fixes #263.

@qnikst
qnikst force-pushed the infinite-bignum branch 2 times, most recently from 4c1a0a3 to 6ee5d39 Compare November 12, 2025 11:01
We support indefinite length bytestring in the Read module.

In order to do it we add two extra variants for bigint deseralization,
both puts us to the slow-path to start consumption of the chunks.

This serialization is considered non-canonical thus canonical read
rejects is. While specification is silent about it, the cbor.me
implementation always converts bigit into a fixed size byte blob.

Fixes well-typed#263.
@coot

coot commented Jul 28, 2026

Copy link
Copy Markdown

There's a subtle bug in this implementation, which I fixed in #384.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bignum decoding doesn't allow indefinite-length bytestrings

2 participants