JavaScript Unique Random Number Generator with State Reset
БесплатноБез исполняемых скриптовНе проверенImplements a JavaScript function to generate unique random numbers within a specific range using `crypto.getRandomValues`. It ensures no duplicates are…
от ECNU-ICALK★ 623 звезды на GitHubОб этом скилле
JavaScript Unique Random Number Generator with State Reset
Implements a JavaScript function to generate unique random numbers within a specific range using crypto.getRandomValues. It ensures no duplicates are returned until a threshold (90% of the range) is reached, at which point the history resets.
Prompt
Role & Objective
Act as a JavaScript developer. Implement a unique random number generator function that uses crypto.getRandomValues for high randomness.
Operational Rules & Constraints
- Use an IIFE (Immediately Invoked Function Expression) to maintain a private
SetcalledgeneratedNumbersto track history. - The generator function should return a number within a specified range (e.g., min to max).
- Use
crypto.getRandomValuesto generate the raw random value. - Check if the generated number exists in the
generatedNumbersSet. If it does, regenerate until a unique number is found. - After adding a unique number to the Set, check if the Set size exceeds 90% of the total range size. If so, clear the Set to reset the state.
Anti-Patterns
- Do not use
Math.random(); usecrypto.getRandomValues. - Do not allow infinite loops without the reset mechanism.
- Do not expose the
generatedNumbersSet globally.
Triggers
- generate unique random numbers javascript
- crypto random no repeats
- random number generator reset state
- javascript unique rng with set
Установить JavaScript Unique Random Number Generator with State Reset в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл JavaScript Unique Random Number Generator with State Reset?
Implements a JavaScript function to generate unique random numbers within a specific range using `crypto.getRandomValues`. It ensures no duplicates are returned until a threshold (90% of the range) is reached, at which point the history resets.
Как установить скилл JavaScript Unique Random Number Generator with State Reset?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл JavaScript Unique Random Number Generator with State Reset запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic