Guid collisions

I have a product that lets game developers create games. Inside of their games they are required to give all the elements of their games GUIDs. I’ve told them that they need to generate their guids using a specific mechanism, but they seem to think that it won’t cause any issues. What I’m concerned about is GUID collisions between games.

Some developers just sequentially increment the last digit of their GUID, others zero out the last block and increment other parts, well others just pull together a random armada of numbers and letters for each one.

My argument is that by doing this it dramatically increases the risk of colliding with other games that are both following the standard, and those that don’t.

Just as a heads up there are potentially hundreds of thousands of GUIDs involved here.

Am I right in thinking this, or is it really improbable that this will really happen?

14

Since you’re not in control of guid creation you need to expect that there will be a collision at some point (if there isn’t one already) and you have to expect that there will be novice developers who don’t see why starting at 1 and counting up is a problem.

To make it impossible you would have to issue all the guids yourself.

But, since people can access other people’s objects purely by a single ID, you also have a big security hole waiting to be exploited and depending on how you choose to fix that, this problem will may wind up a moot point.

3

I’ve told them that they need to generate their guids using a specific
mechanism

Are you in power? Reject code not using your mechanism.

If using the mechanism is a requirement then it’s bad developers don’t use it. But you might want to give them an easy implementation.

Btw. if your product lets’ programmers create games why not let your product generate the guids?

There’s a couple of things to note.

You will have collisions. Even if they are mathematically improbable, they’re still possible. And given Murphy’s Law, you will end up seeing the improbable become reality at the most inconvenient time, like when you’re trying to final. If you’re using any kind of hashing algorithm, you need to be aware that you will at some point have hash collision, and need a process to fix it. This is quite often just adding more, unique information into the hash.

If you’re letting people generate their own hash’s ids. You’re in for a world of hurt. There needs to be one way of hashing data, and that way needs to provide enough “uniqueness” to minimize collisions. Either that or you use a centralized GUID factory that doles out unique GUIDs. Of course, there are various threading issues with this approach.

Although you could simply have a GUID factory per thread, and give each GUID factory a different starting point a few billion id’s apart from each other. This can also be a handy way to work out which thread exploded.

The real answer to “which approach” you should take should come from how your resource system works. If you’re using a centralized asynchronous resource system (and you should be), you can assign GUID’s at that point. If you’re creating random objects all over the shop in various threads, then you’re going to have to go with one of the other options above.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật