Skip to content

util: render and parse names in the MoQT safe form - #532

Merged
afrind merged 1 commit into
mainfrom
util/safe-track-name
Aug 10, 2026
Merged

util: render and parse names in the MoQT safe form#532
afrind merged 1 commit into
mainfrom
util/safe-track-name

Conversation

@afrind

@afrind afrind commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

safeName() renders MoQT namespaces and track names in the form RECOMMENDED by moq-transport, "Representing Namespace and Track Names"; parseSafeBytes(), parseSafeNamespace() and parseSafeFullTrackName() invert it.

The encoding is injective, so callers that key on the result — metric labels, filenames, authorization schemes — cannot have two distinct names collapse onto one rendering, while names made of ordinary characters stay readable. Parsing splits a full name at the last "--", which stays unambiguous because an encoded track name never contains a hyphen.


This change is Reviewable

@gmarzot gmarzot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmarzot reviewed 5 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on afrind).

@gmarzot

gmarzot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

mmmm ... "injective" but not "surjective"

"The encoding function $f$ is injective, which is logically equivalent to the existence of a left-inverse decoding function $g$ such that $g \circ f = \text{id}_X$. Reversibility is thus guaranteed over the image $f(X)$.While the mapping is left-invertible, it is not a bijection due to non-surjectivity over the codomain $Y$. Therefore, global two-sided invertibility is absent, as the decoder must handle an undefined or error state for arguments $\notin \text{Im}(f)$."

@afrind

afrind commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

mmmm ... "injective" but not "surjective"

Ok clear evidence I did not write the commit summary

@afrind
afrind force-pushed the util/safe-track-name branch 3 times, most recently from 5a296d6 to c59da3a Compare August 5, 2026 18:17

@gmarzot gmarzot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmarzot reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on afrind).

safeName() renders MoQT namespaces and track names in the form RECOMMENDED by
moq-transport, "Representing Namespace and Track Names"; parseSafeBytes(),
parseSafeNamespace() and parseSafeFullTrackName() invert it.

The encoding is injective, so callers that key on the result — metric labels,
filenames, authorization schemes — cannot have two distinct names collapse onto
one rendering, while names made of ordinary characters stay readable. Parsing
splits a full name at the last "--", which stays unambiguous because an encoded
track name never contains a hyphen.
@afrind
afrind force-pushed the util/safe-track-name branch from c59da3a to 9177ad5 Compare August 10, 2026 19:55
@afrind
afrind merged commit 41b8fa3 into main Aug 10, 2026
16 checks passed
@afrind
afrind deleted the util/safe-track-name branch August 10, 2026 20:57
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.

2 participants