First, I am no crypto expert although I am doing the MOOC.
I have an item which has as id: uuidv4
When I create this item:
- I create a new uuidv4
- check if it already exists
- and if not, I store it in the db.
Now this item can be deleted. So lets say that there could be a conversation 'about' this item. And in that conversation is stored the id of the-just-deleted-item. After the item has been deleted, the conversation is not automatically deleted. If some user now creates a new item (get new uuidv4) and passes the check-if-already-exists test, it could still reference an already existent conversation. THAT'S WRONG
To battle this, I was thinking of appending a UNIX timestamp (in secs) to the uuidv4 when it is created, then hash that, then store the hash. so the same uuid later on will have a different timestamp, and thus be different!
Question(s): Which hashing algorithm to use?
Or maybe just concatenate the uuidv4 + UNIX timestamp (in secs)?