Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

算法的几个问题 #3

Open
Mage-White opened this issue May 9, 2024 · 0 comments
Open

算法的几个问题 #3

Mage-White opened this issue May 9, 2024 · 0 comments

Comments

@Mage-White
Copy link

  1. 第三段和第四段是两个8位的随机因子,可以组合成的效果是255 * 255,其实从效果上看,和一个16位的随机因子一样的。分成2段反而需要生成2次随机数,性能浪费;
  2. 第二段的自增数,在分布式情况下,多台机器的自增数是有相同的情况的,那么id碰撞的概率是由后16位决定的,最低是65536分之一的概率碰撞,如果数据增多,碰撞概率指数级上升。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant