Generate random value

Generate random value in JavaScript — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
I need a random token for a password-reset link for user 16742. Generate a cryptographically secure…
I need a random token for a password-reset link for user 16742. Generate a cryptographically secure random string of 32 URL-safe characters, base64-url encoded, and attach it to resetTokens with an expiry 15 minutes from now. Return the token so I can send it in the email.

Improve — make it easier to accept

+
Before I put random tokens into production, make the generation easy to audit: show the entropy…
Before I put random tokens into production, make the generation easy to audit: show the entropy bits, write a one-line comment explaining why the method is cryptographically secure, and flag any uses of Math.random or non-cryptographic APIs. Also provide a deterministic fallback for tests that can be toggled without changing the production path.

Decide — diagnose the stuck moment

+
I just generated a password-reset token for user 16742 and a support case says the token matched…

I issued a reset token and a user reported they received the same token twice.

I just generated a password-reset token for user 16742 and a support case says the token matched another recent token. I suspect a non-cryptographic PRNG slipped into the code path, or I accidentally seeded a deterministic routine for tests. I can’t tell whether the bug is in token creation, storage, or a test harness. What is the most likely cause and the immediate code checks I should run to confirm and fix it now?

Become — change the pattern

+
Over time I see intermittent token collisions or predictable tokens in logs and it costs hours in…

Tokens occasionally collide in logs

Over time I see intermittent token collisions or predictable tokens in logs and it costs hours in incident triage. I keep using ad-hoc token helpers that are convenient for dev but unsafe for prod. What practice and minimal tooling change will stop these incidents, and how should I handle testability without weakening security in production?

Next to this one

Other programming language work people do in JavaScript.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.