什么是“去中心化唯一性算法”?
COM中创建GUID的函数(CoCreateGUID)使用“分散唯一性算法”,但我的问题是,它是什么?
有人能解释一下吗?
The function in COM to create a GUID (CoCreateGUID) uses a "Decentralized Uniqueness Algorithm", but my question is, what is it?
Can anybody explain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种生成 ID 的方法,该方法可以在一定程度上保证唯一性,而不依赖于通过中央“ID 提供者”进行任何类型的协调(这需要网络连接并且可能难以组织)。基本上有两种方法可以实现这一点,但实际上都没有提供绝对的保证:
A method to generate an ID that has some guarantee to be unique without relying on any kind of coordination through a central "ID provider" (which requires a network connection and can be hard to organize). There are basically two methods for this, neither actually providing an absolute guarantee:
我搜索了当地的图书馆和档案馆,但找不到特定算法的参考。但通常这种类型的算法用于生成只能出现一次的 128 位 GUID 值。使用标准随机数生成算法不会生成真正的随机性。因此,在这种情况下,他们采用了几个值,包括:
通过利用这样的功能,程序员可以确保GUID的值是唯一的,而无需集中服务器来跟踪和生成所有用户GUID值。
您可以在此处了解有关随机数生成的更多信息
I have searched my local library and archives but I cannot find reference to the specific algorithm. But generally this type of algorithm is used to generate 128-bit GUID values that can only occur once. Using a standard random number generation algorithm does not generate true randomness. So in this case they have taken several values including :
By utilizing such a function the programmer can ensure that the values of GUID's are unique without having to a centralized server that tracks and generates all user GUID values.
You can read more about random number generation here