Proper 50% chance random number generator implementation for player

How long are those win-strikes? When I test this:

console.log(Math.random());

I get four or five values in a row that are bigger than 0.5 then one below 0.5 then another bigger than 0.5. If this is a problem for game logic, then you don't need random numbers but plot-armor. If you use only one random number generator for all players, then of course some players can steal another player's "destiny" and those players can have very bad or very good dice rolls.

To overcome the issue of "fairness" between players, you can have a unique seed for each player's random number generator. This is possible (and fast) in C++. Calling a compiled C++ console program from Node-js is easy. The only issue would be optimizing it for millions of concurrent players. C++'s std::mt19937 is fast enough and takes a seed value (from os too).

Since you tagged C#, same thing can be done within C# too.new Random(some random seed here) should give similar results. Then you can host the algorithm as a micro-service and make it accessed by nodejs (assuming main backend part of app is on nodejs).

Lastly, you can have one micro-service process per player for the RND. This should give everyone their own seeds for random number generations. But too many players would mean too many threads which is very bad for performance unless dice-rolls are very rare. For example,I can start 100 processes on my 8 core cpu with this:

"use strict";

var cluster = require('cluster');
if(cluster.isMaster){for(let i=0;i<100;i++) { cluster.fork(); }}

console.log(Math.random());

but it starts very slow and hosting a RND server per process could be even slower. So, only main process should host the RND service and internally communicate with worker processes. Cluster module of NodeJs lets worker processes communicate with main process. Pure event-driven communication (no spin-wait whatsoever) between worker(RND) processes and main process should be CPU-friendly but still if all of (millions of) players throw dices at the same time then the process/thread-switching overhead would be visible and each process takes certain amount of memory so the RAM capacity becomes important too. There are custom random number generators for NodeJs that can take seed for much less CPU/RAM usage.