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

关于UUIDUtils 疑问 #1

Open
changhe626 opened this issue Jun 12, 2017 · 2 comments
Open

关于UUIDUtils 疑问 #1

changhe626 opened this issue Jun 12, 2017 · 2 comments

Comments

@changhe626
Copy link

你好,我看了你的UUIDUtils 这个类,有点不是很明白,为什么要getJVM(),getHighTime(),getCount()
我一般的习惯就是UUID.randomUUID,再替换一下"-",就拿去用了,能不能说说为什么,谢谢

@xuan698400
Copy link
Owner

这样只是为了更好的防止冲突,你想好了,把虚拟机因数,时间因数都放到里面去,随机性就跟大了,java的randomUUID其实还是有一定概率重复的,虽然概率很小,他只是一个伪随机,

@changhe626
Copy link
Author

好的谢谢

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

2 participants