Checking if a GUID is already in use

I’m making a pet/item system and giving each of them a GUID (api / basically a unique ID) when created to try and easily counter duplication. However, how would I actually check if the GUID is already in use?

The only thing I’ve really thought of trying was saving a table of GUID’s that are in use and looping through them, but that wouldn’t really work for many reasons (constantly sending saving requests, potentially having billions to loop through each time… etc)

The way I’m saving inventories is like this:

Data store
    [player id] = {
        [GUID] = {}-- random item info like type, name, level...
    }

If anyone has an idea on how to do this or maybe how to save the inventories better I would appreciate a reply!

There are so many possible GUIDs that it’s honestly not worth worrying about. The number is something like 1,000,000,000,000,000,000,000,000 unique GUIDs. So if I were you, I wouldn’t bother checking for duplicates.

16 ^ 32 = 3.4028237e+38

GUIDs are made up of 36 digits, 4 of those are underscores, the remaining 32 can be 1 of 16 possible digits (hexadecimal).