YouTube 唯一标识符
我在 YouTube 上注意到他们的密钥看起来像这样“BwgT06NY1FE
”。我只是想知道这种类型的密钥是如何创建的?这是基于 GUID 的吗?
I noticed on YouTube their keys look like this "BwgT06NY1FE
". I was just wondering how is this type of key created? Is this based on a GUID?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这很可能是 Base36。所有字母和数字。这很常见,因为您可以在数据库中使用“SERIAL”并递增它,然后从 URL 中的 Base36 进行解析。
它可以生成漂亮的 URL(bit.ly 也使用这种格式),但也有一些缺点。也就是说,您不想将它用于任何类型的私有数据,因为人们只需输入随机数即可获得结果(除非有人尝试数十亿次,否则不太可能有人猜出您的数据库使用的 GUID)。 。
This is most likely Base36. All letters and numbers. It's pretty common, because you can use a "SERIAL" in a database and just increment it, and then just parse from Base36 in your URL.
It makes for nice URLs (bit.ly also uses this format), but has some drawbacks. Ie, you wouldn't want to use it for any sort of private data because people can just type in a random number and get a result (it's unlikely someone could guess a GUID in use by your database unless they try a few billion)..