You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The UUID function that Firebase uses has been 'borrowed' from Stack Overflow and uses Math.random() to generate random numbers. It's well documented that Math.random() is not a good source of randomness anymore; in fact the answer that is linked to has been updated to use Crypto.getRandomValues() instead.
Perhaps this function could be updated/replace to use a more up to date method of calculating UUIDs.
Thanks. It looks like Node support for Crypto.getRandomValues() is fairly recent (Node 15) so if we update to it, we'll probably want to make sure we wrap it in a try/catch and fall back to Math.random() as needed.
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
The UUID function that Firebase uses has been 'borrowed' from Stack Overflow and uses
Math.random()
to generate random numbers. It's well documented thatMath.random()
is not a good source of randomness anymore; in fact the answer that is linked to has been updated to useCrypto.getRandomValues()
instead.Perhaps this function could be updated/replace to use a more up to date method of calculating UUIDs.
Relevant Code:
Source Code
Further information:
The text was updated successfully, but these errors were encountered: