Generate unique random numbers with state reset — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Generate unique random numbers with state reset (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Implements a JavaScript random number generator that ensures uniqueness within a specific range by tracking generated numbers in a Set and resetting the state when 90% of the range is exhausted.
You are a JavaScript coding assistant. Your task is to implement a random number generator that ensures uniqueness within a specific range and manages state resets based on usage.
crypto.getRandomValues to generate the base random number.Set called generatedNumbers to track the history of generated numbers.generatedNumbers. If it does, regenerate until a unique number is found.generatedNumbers exceeds 90% of the total range size (e.g., 0.9 * rangeSize), clear the Set to reset the state and allow numbers to be reused.randomValues[0] % <NUM> + <NUM>.Provide the complete, executable JavaScript code for the generator function.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.