
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.
@xtia/alea-rc
Advanced tools
Alea is a utility wrapper for turning random numbers into useful values. Give it any source of randomness, get a toolkit for dice, samples, strings, and more.
npm i @xtia/alea (pending release; use @xtia/alea-rc to preview)
import { alea, cryptoAlea } from "@xtia/alea";
// generate values (driven by Math.random())
const damage = alea.between(50, 150);
const loot = alea.chance(0.125) ? "epic" : "common";
const id = alea.string(5, "abcdef0123456789");
const npcName = alea.sample(["Alice", "Bob", "Charlie"]);
// same API, secure source (driven by environment's crypto)
const id = cryptoAlea.string(16, alphanumeric);
Use any provider as RNG source:
import {
aleaFromFunc,
aleaFromSeed,
aleaFromByteSource,
} from "@xtia/alea";
// deterministic, with seed (uses Mulberry32 PRNG):
const seededRng = aleaFromSeed("abc123");
// custom source of randomness:
const xkcdRng = aleaFromFunc(() => 4/6); // https://xkcd.com/221/
// from random byte providers:
const secureRng = aleaFromByteSource(
buf => hardwareRNG.fillRandomBytes(buf)
);
Or use a provided PRNG algorithm:
import {
mulberry32,
sfc32,
xoshiro128pp,
} from "@xtia/alea/prng";
// each returns an Alea instance:
const fast = mulberry32("my-seed");
const varied = sfc32(1, 2, 3, 4);
const strong = xoshiro128pp(5, 6, 7, 8);
const reproducibleId = varied.string(12, hexadecimal);
FAQs
RNG utilities
We found that @xtia/alea-rc demonstrated a healthy version release cadence and project activity because the last version was released less than 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.