Files
rand-tools/public/docs/ARCHITECTURE.md
T
2026-09-01 02:53:47 +02:00

1.0 KiB

Architecture

Random Tools is a static React/Vite application wrapped in the shared Toolbox shell. random/source.ts exposes one common interface over two deliberately distinct local sources: browser WebCrypto with rejection-sampled integers, and the versioned toolbox-helpers xoshiro128** seeded generator. Secure mode never falls back to deterministic mode.

random/generators.ts builds bounded numbers, strings, identifiers, dice, samples, shuffles, passphrases and normal samples on that interface. Each successful local result includes source identity, parameters and deterministic state where applicable. Operations are synchronous and bounded, so version 0.1 creates no worker.

random/remote.ts is a separate, explicitly selected RANDOM.ORG integer client. Requests are validated, serialised, credentialless, no-referrer, no-store and subject to a 120-second abort timeout; responses are checked against the requested count/range. This is the only runtime network path and the production CSP permits only that origin in addition to self.