pkg/dns/encoding.go has a doc-comment example that doesn't match the actual output of big.Int.Text(36):
// EncodeAccountID converts AWS account ID (12 decimal digits) to base36 (7 chars)
// Example: "123456789012" -> "1s69p4h"
Standard base-36 of 123456789012 is 1kpqzg2c (8 chars), not 1s69p4h. Verified with Python, Node (BigInt("123456789012").toString(36)), and against the sibling implementation in lambda/dns-updater/main.go, whose getFullDNSName doc comment correctly shows -> my-instance.1kpqzg2c.spore.host for the same input.
So the two files give contradictory examples for identical logic; pkg/dns/encoding.go's is the stale/incorrect one. Also note the "(7 chars)" is misleading — 12-digit account ids encode to 8 base36 chars.
Cosmetic (doc-only; the code is correct), but confusing when reimplementing the DNS-name scheme against it. Found while building a browser-side reproduction of the {name}.{base36(account)}.spore.host naming for a spawn-ts demo.
pkg/dns/encoding.gohas a doc-comment example that doesn't match the actual output ofbig.Int.Text(36):Standard base-36 of
123456789012is1kpqzg2c(8 chars), not1s69p4h. Verified with Python, Node (BigInt("123456789012").toString(36)), and against the sibling implementation inlambda/dns-updater/main.go, whosegetFullDNSNamedoc comment correctly shows-> my-instance.1kpqzg2c.spore.hostfor the same input.So the two files give contradictory examples for identical logic;
pkg/dns/encoding.go's is the stale/incorrect one. Also note the "(7 chars)" is misleading — 12-digit account ids encode to 8 base36 chars.Cosmetic (doc-only; the code is correct), but confusing when reimplementing the DNS-name scheme against it. Found while building a browser-side reproduction of the
{name}.{base36(account)}.spore.hostnaming for a spawn-ts demo.