知识卡片
唯一ID转换为Base62
先生成全局唯一数值 ID,再以 Base62 表示,编码本身不引入新碰撞。长 URL 与短码映射仍须持久保存;编码不是对 URL 的可逆压缩,也不解决并发创建同一长 URL 的全部幂等问题。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 第08章 短链
原书出处 · 1 处
- 短链 · 查看原书依据
Base 62 conversion Base conversion is another approach commonly used for URL shorteners. Base conversion helps to convert the same number between its different number representation systems. Base 62 conversion is used as there are 62 possible characters for hashValue. Let us use an example to explain how the conversion works: convert 1115710 to base 62 representation (1115710 represents 11157 in a base 10 system).
参考来源
- 位置:《System Design Interview – An insiders guide, Second Edition》第08章《短链》(来源项目 book-sources;源文件:extracted/System Design Interview – An insiders guide, Second Edition/_epub-src/text/part0021_split_003.html)
- 结论依据:原文在该位置给出所述对象、机制或比较,支持本卡的解释;原书未展开的实现不作为已证明结论,算式与一致性边界在正文明确限定。
- 原始内容:Base 62 conversion Base conversion is another approach commonly used for URL shorteners. Base conversion helps to convert the same number between its different number representation systems. Base 62 conversion is used as there are 62 possible characters for hashValue. Let us use an example to explain how the conversion works: convert 1115710 to base 62 representation (1115710 represents 11157 in a base 10 system).