JavaScript Math.random function generates random numbers using PRNGs (pseudo-random number generators). Since 2015, major browser JavaScript engines updated to xorshift128+. My question is does anyone know if Brave also does the same?
Asked
Active
Viewed 101 times
-5
-
5Brave is based on Chromium and uses the same V8 JavaScript engine that other Chromium browsers use. – Barmar Jul 08 '22 at 23:43
-
1…and while of course it would be possible that they did override the implementation of `Math.random` with a different one, this would be extra effort and there's no reason for them to do it. – Bergi Jul 08 '22 at 23:46
-
Yes, but I suspect they might have somehow overridden it. I wrote a simple game and while testing in Brave, in two different instances it seems to have generated exactly 50% - 50% win/loss in a game of chance within 27 and 33 iterations whereas Google Chrome or FF didn't do exactly the same until over 150 iterations. I know eventually it would be 50-50 yet... – Shubhojoy Mitra Jul 10 '22 at 20:14
-
UPDATE: I realized I made a mistake gentlemen. The 33 iterations was while testing with Google Chrome. Does this mean this can be pretty much expected with xorshift128+? Guess that is why it's known as "sub par"... your thoughts? – Shubhojoy Mitra Jul 11 '22 at 17:15
1 Answers
0
The response to your question is, yes does the same. Brave is based on Chromium using V8 JS Engine as any other Chromium browser based uses.

Bernardo Moraes
- 130
- 8