This relates to this question. I am using the code below from this answer to generate UUID in JavaScript:
\'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\'.replace(/[
Indeed there are collisions but only under Google Chrome. Check out my experience on the topic here
http://devoluk.com/google-chrome-math-random-issue.html
(Link broken as of 2019. Archive link: https://web.archive.org/web/20190121220947/http://devoluk.com/google-chrome-math-random-issue.html.)
Seems like collisions only happen on the first few calls of Math.random. Cause if you just run the createGUID / testGUIDs method above (which obviously was the first thing I tried) it just works with no collisions whatsoever.
So to make a full test one needs to restart Google Chrome, generate 32 byte, restart Chrome, generate, restart, generate...