
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
fair-random
Advanced tools
A simple utility to generate random numbers using a provable fair algorithm.
A simple utility to generate random numbers using a provable fair algorithm.
$ npm install fair-random
import FairRandom from "fair-random";
const fairRandom = new FairRandom("server_seed", "client_seed", 0);
const num1 = fairRandom.random();
//=> 0.5588404021691531
const num2 = fairRandom.random();
//=> 0.569565019570291
Class: FairRandom
new FairRandom(serverSeed, clientSeed, nonce)
serverSeed string: A secret seed provided by the server.clientSeed string: A seed provided by the client. This allows the client to have an influence on the randomness.nonce number: A number that is incremented with each bet to ensure different outcomes.Creates a new FairRandom object containing the random method.
fairRandom.random()
Returns a number that's greater than or equal to 0 and less than 1. This function utilises the cryptographic hash function
HMAC_SHA256 to generate bytes which are then used to generate floats between 0 and 1.
This project is licensed under the MIT License.
FAQs
A simple utility to generate random numbers using a provable fair algorithm.
We found that fair-random demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.