<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>rusqsieve — integer factorization in your browser</title>
<meta
name="description"
content="A portable self-initializing quadratic sieve compiled to WebAssembly, running in parallel across Web Workers."
/>
<link rel="stylesheet" href="./index.css" />
<link
rel="icon"
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ctext y='14' font-size='14'%3E%E2%88%9A%3C/text%3E%3C/svg%3E"
/>
</head>
<body>
<main>
<header>
<h1>rusqsieve</h1>
<p class="tagline">
A portable self-initializing quadratic sieve, compiled to WebAssembly and
run in parallel across Web Workers.
</p>
</header>
<section class="panel">
<label for="input">Number to factor</label>
<div class="entry">
<div class="input-shell">
<textarea
id="input"
class="number-input"
inputmode="numeric"
enterkeyhint="go"
autocomplete="off"
spellcheck="false"
aria-multiline="false"
rows="1"
wrap="soft"
placeholder="e.g. 1256983314983137644553747197792065202513411738941"
></textarea>
<div id="input-mirror" class="input-mirror" aria-hidden="true"></div>
</div>
<button id="go" disabled>Factor</button>
</div>
<p id="input-info" class="input-info"></p>
<div class="generator">
<label for="rsa-bits">Generate an RSA-style semiprime</label>
<div class="gen-row">
<input
type="range"
id="rsa-bits"
min="128"
max="384"
step="16"
value="192"
/>
<output id="rsa-bits-label" class="gen-bits">192 bits</output>
<button id="rsa-gen" class="gen-btn" type="button">Generate</button>
</div>
</div>
<div class="examples">
Try:
<button
class="ex"
data-n="20128319311760246747500957225241816458030938064209221348089230748651"
>
224-bit semiprime
</button>
<button
class="ex"
data-n="1439386119315489146152804542305563611282367122902697499084529345625385831"
>
240-bit semiprime
</button>
<button
class="ex"
data-n="58618826500571958212699613307230935158347844607421776748140044044946589662711"
>
256-bit semiprime
</button>
<button
class="ex"
data-n="6288678922112871440697159955072147085714338210755436568817751773613552354991015399"
>
272-bit semiprime
</button>
</div>
</section>
<section class="progress">
<div id="meter" class="meter"><div id="bar" class="bar"></div></div>
<p id="status" class="status">Loading…</p>
</section>
<section id="result" class="result" aria-live="polite"></section>
<footer>
<span id="workers" class="workers"></span>
<span class="note">
Single WebAssembly module; no threads inside the math core. All factors
verified by product before display.
</span>
</footer>
</main>
<script type="module" src="./index.js"></script>
<script type="module">
const input = document.getElementById("input");
for (const b of document.querySelectorAll(".ex"))
b.addEventListener("click", () => {
input.value = b.dataset.n;
input.dispatchEvent(new Event("input"));
input.focus();
});
</script>
</body>
</html>