Segment generation
Prime numbers are generated in segments covering intervals of 446,185,740 consecutive integers. Each segment consists of two aligned blocks of 223,092,870 integers and can be processed independently by a modern web browser.
A WebAssembly sieve performs the main prime-number calculation. JavaScript then uses the production 23# coprime reduction: each 223,092,870-integer block has 36,495,360 candidate bits. A complete production segment has a canonical raw bitmap size of exactly 9,123,840 bytes.
Compression and submission
The raw bitmap is further compressed using gzip.
The generating browser then submits to our server:
- the prime count;
- the SHA-256 hash of the canonical 23# coprime-reduction bitmap;
- the gzip file;
- the SHA-256 hash of the gzip file.
The server strictly checks the gzip streams, storage format, expected lengths, counts and SHA-256 hashes. It also performs randomized primality checks before storing the generated files provisionally.
A validation task is then scheduled to be run on another browser for an independent cross-check.
If you want to participate to the generation or validation, click the Help Generate Primes button on the homepage. This button is available only when we need some help generating more prime numbers!