Skip to content

ruslanlap/PowerToysRun-RandomGen

Repository files navigation

RandomGen Logo

🎲 RandomGen for PowerToys Run 🎲

Generate random data instantly with a single keystroke. Cool features like smart PIN generation, secure password creation, and more.

πŸ“Š Download Statistics

Total Downloads Latest Release Downloads

πŸŽ₯ Demo

Overview of RandomGen commands

Main Demo showing various RandomGen commands

Command: rd password 16

Generate a secure 16-character password

Password Generation Demo

Commands: rd pin 6 and rd color

Generate a 6-digit PIN and random hex color

PIN and Color Generation Demo

Commands: rd address and rd date

Generate a random address and date

Address and Date Generation Demo

Command: rd guid

Generate a random GUID/UUID

GUID Generation Demo

Command: rd name

Generate a random person name

Name Generation Demo

Command: rd number 1-1000

Generate a random number between 1 and 1000

Number Generation Demo

πŸ“‹ Table of Contents

✨ Features

RandomGen is a powerful PowerToys Run plugin that generates various types of random data with a single keystroke. Perfect for developers, testers, and anyone who needs quick access to random data.

Key Features

  • πŸ” Cryptographically Secure Passwords - Generate strong passwords with mixed case, numbers, and symbols
  • πŸ“ Secure PIN Codes - Create numeric PINs with smart pattern detection to avoid weak PINs like 1234 or 0000
  • πŸ‘€ Personal Data - Generate realistic names, emails, phone numbers, and addresses
  • 🏒 Business Data - Company names and other business-related information
  • πŸ“… Date Generation - Random dates within customizable ranges
  • πŸ”’ Number Generation - Random numbers with custom min-max ranges
  • πŸ†” Unique Identifiers - GUIDs/UUIDs for development and testing
  • 🎨 Color Codes - Random HEX colors for design and testing
  • 🌐 Web Data - URLs and domains for testing
  • πŸ’³ Payment Testing - Credit card numbers (fake, for testing only)
  • πŸ“ Lorem Ipsum - Placeholder text with customizable word count

Technical Highlights

  • Plugin ID: EFADBA167C1B41D8A7426A7DF808D28E
  • Action Keyword: rd
  • Thread-Safe Design - Optimized for performance with thread-local Faker instances
  • Smart Caching - Improved performance with intelligent result caching
  • Cryptographically Secure - Uses System.Security.Cryptography.RandomNumberGenerator for secure random generation
  • Intelligent Suggestions - Smart autocomplete for commands
  • Context Menu Support - Right-click options for copying and regenerating values

πŸš€ Quick Start

  1. Download the latest release for your architecture (x64 or ARM64)
  2. Extract the ZIP file to your PowerToys Run plugins directory:
    %LOCALAPPDATA%\Microsoft\PowerToys\PowerToys Run\Plugins\RandomGen\
    
  3. Restart PowerToys
  4. Press Alt+Space to open PowerToys Run
  5. Type rd followed by what you want to generate (e.g., rd password)
  6. Best practice: Press the Space button to regenerate a new value.

πŸ“‹ Changelog

v1.0.2 - Enhanced Password Generator Options

Password Generator Options Password Generator Options2

  1. Enhanced Option Syntax Support

    • Now supports multiple ways to specify options:
      • Exclusion: -upper, -special, -numeric, -lower
      • Inclusion: +upper, +special, +numeric, +lower
      • Natural language: noupper, no-special, nonumbers
  2. Better Error Handling

    • Ensures at least one character type is always enabled
    • Handles edge cases where all types are disabled
    • Validates password length accommodates required character types
  3. Improved Display

    • Better subtitle showing what's excluded: (16 chars, no upper,special)
    • Clearer option descriptions in tooltips
  4. Usage Examples

    • rd password 16 -special β†’ 16-char password without symbols
    • rd password 22 -numeric β†’ 22-char password without numbers
    • rd pwd 12 -upper -special β†’ 12-char password with only lowercase + numbers
    • rd password 20 noupper β†’ 20-char password without uppercase letters

πŸ” Usage

Basic Commands

Use the activation keyword rd followed by the data type you want to generate:

Command Example Description
rd password [length] rd password 16 Generate a secure password (default: 12 chars)
rd pwd [length] rd pwd 16 Alias for password command
rd pin [length] rd pin 6 Generate a numeric PIN (default: 4 digits)
rd email rd email Generate a random email address
rd name rd name Generate a random full name
rd address rd address Generate a random address
rd phone rd phone Generate a random phone number
rd company rd company Generate a random company name
rd lorem [count] rd lorem 25 Generate lorem ipsum text (default: 10 words)
rd number [min-max] rd number 1-1000 Generate a random number (default: 1-100)
rd num [min-max] rd num 1-1000 Alias for number command
rd date rd date Generate a random date
rd guid rd guid Generate a random GUID/UUID
rd uuid rd uuid Alias for guid command
rd color rd color Generate a random hex color
rd url rd url Generate a random URL
rd creditcard rd creditcard Generate a random credit card number (test use only)
rd credit rd credit Alias for creditcard command

Supported Locales

Bogus supports many locales. Use rd locale <code> to change the language for generated data. Supported locale codes include: af_ZA, ar, az, cz, de, de_AT, de_CH, el, en, en_AU, en_AU_ocker, en_BORK, en_CA, en_GB, en_IE, en_IND, en_NG, en_US, en_ZA, es, es_MX, fa, fi, fr, fr_CA, fr_CH, ge, hr, id_ID, it, ja, ko, lv, nb_NO, ne, nl, nl_BE, pl, pt_BR, pt_PT, ro, ru, sk, sv, tr, uk, vi, zh_CN, zh_TW, zu_ZA.

| rd locale [code] | rd locale fr | Change data generation locale |

Examples

# Generate a 16-character password
rd password 16

# Generate a 6-digit PIN
rd pin 6

# Generate a random email address
rd email

# Generate a random number between 1 and 1000
rd number 1-1000

# Generate 25 words of lorem ipsum text
rd lorem 25


# Change locale to French
rd locale fr (or other `af_ZA`, `ar`, `az`, `cz`, `de`, `de_AT`, `de_CH`, `el`, `en`, `en_AU`, `en_AU_ocker`, `en_BORK`, `en_CA`, `en_GB`, `en_IE`, `en_IND`, `en_NG`, `en_US`, `en_ZA`, `es`, `es_MX`, `fa`, `fi`, `fr`, `fr_CA`, `fr_CH`, `ge`, `hr`, `id_ID`, `it`, `ja`, `ko`, `lv`, `nb_NO`, `ne`, `nl`, `nl_BE`, `pl`, `pt_BR`, `pt_PT`, `ro`, `ru`, `sk`, `sv`, `tr`, `uk`, `vi`, `zh_CN`, `zh_TW`, `zu_ZA` )
Locale Selection - Setting locale
Locale Selection - UK locale
Locale Selection - FR locale

β˜• Support

Enjoying RandomGen? β˜• Buy me a coffee to support development:

Buy me a coffee

Advanced Features

  • Context Menu - Right-click on any result to:

    • Copy to clipboard (Ctrl+C)
    • Generate a new value (F5)
  • Smart Autocomplete - Type part of a command to see suggestions

  • Intelligent Caching - Recently generated values are cached for improved performance

βš™οΈ Installation

Prerequisites

  • PowerToys (v0.75 or later)
  • Windows 10/11 (x64 or ARM64)
  • .NET 9.0 Runtime (included with PowerToys)
  • Approximately 2MB of disk space

Installation Steps

Method 1: Using the Release Package

  1. Download the latest release for your architecture (x64 or ARM64)
  2. Extract the ZIP file to your PowerToys Run plugins directory:
    %LOCALAPPDATA%\Microsoft\PowerToys\PowerToys Run\Plugins\RandomGen\
    
  3. Restart PowerToys
  4. Enable the plugin in PowerToys Settings β†’ PowerToys Run β†’ Plugin Manager

Method 2: Manual Installation from Build

  1. Build the project (see Building from Source)
  2. Copy all files from the RandomGen\Publish\ folder to your PowerToys Run plugins directory:
    %LOCALAPPDATA%\Microsoft\PowerToys\PowerToys Run\Plugins\RandomGen\
    
  3. Restart PowerToys
  4. Enable the plugin in PowerToys Settings β†’ PowerToys Run β†’ Plugin Manager

Verifying Installation

After installation, press Alt+Space to open PowerToys Run, then type rd to see if the plugin is working correctly.

🧩 Requirements

  • Windows 10/11 (x64 or ARM64)
  • PowerToys v0.75 or later
  • .NET 9.0 Runtime (included with PowerToys)
  • Approximately 2MB of disk space

πŸ› οΈ Building from Source

PTRUN Compliance

This plugin is fully compliant with PowerToys Run validation requirements:

  • βœ… PTRUN1301: Package naming follows the <name>-<version>-<platform>.zip convention
  • βœ… PTRUN1303: SHA256 checksums are generated for all packages
  • βœ… PTRUN1401: Plugin version in metadata matches filename version
  • βœ… PTRUN1402: No unnecessary PowerToys dependencies included

The GitHub Actions workflow automatically ensures compliance with these requirements.

Prerequisites

Build Steps

# Clone the repository
git clone https://github.com/ruslanlap/RandomGen.git
cd RandomGen

# Restore dependencies
dotnet restore

# Build the solution
dotnet build -c Release

# Create a publishable version (optional)
dotnet publish -c Release -o ./Publish

The built plugin will be in RandomGen\bin\Release\net9.0-windows10.0.22621.0 or in the Publish directory if you ran the publish command.

Project Structure

  • RandomGen/Community.PowerToys.Run.Plugin.RandomGen/ - Main plugin code
    • Main.cs - Core plugin implementation
    • Images/ - Plugin icons
    • plugin.json - Plugin metadata
  • RandomGen/Community.PowerToys.Run.Plugin.RandomGen.UnitTests/ - Unit tests

Dependencies

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Ideas for Contribution

  • New Data Types - Add more types of random data generation
  • Localization - Add support for more languages and region-specific data formats
  • Settings UI - Create a settings page for customizing default values
  • Performance Optimizations - Improve caching and thread safety
  • Enhanced Validation - Add more validation for generated data
  • Unit Tests - Expand test coverage
  • Documentation - Improve inline code documentation and user guides

Development Guidelines

  • Follow the existing code style and patterns
  • Ensure all new features have appropriate unit tests
  • Use thread-safe practices for all data generation
  • Document any new commands or features
  • Test on both x64 and ARM64 architectures if possible

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ’¬ Feedback and Support

If you encounter any issues or have suggestions for improvement, please open an issue on GitHub.

❓ FAQ

How do I change the default action keyword?

You can change the action keyword in PowerToys Settings β†’ PowerToys Run β†’ Plugin Manager β†’ RandomGen β†’ Action Keyword.

Are the generated passwords secure?

Yes, passwords are generated using cryptographically secure random number generation methods from the .NET framework, ensuring high entropy and unpredictability.

Can I use this data in production?

The generated data is intended for testing, development, and demonstration purposes only. While passwords are cryptographically secure, other data like names, addresses, and credit card numbers are fictional.

Does this plugin work offline?

Yes, RandomGen works completely offline and doesn't require an internet connection.

How can I add a new data type?

To add a new data type, you would need to modify the Main.cs file, add a new generator method, and update the command handling logic. See the Contributing section for more details.

πŸ”’ Security Note

  • Secure Password Generation - Passwords are generated using System.Security.Cryptography.RandomNumberGenerator for cryptographically secure randomness
  • PIN Security - PINs are checked against common patterns (like 1234, 0000) to avoid weak PINs
  • Fake Data Only - All generated data (names, addresses, credit cards, etc.) is completely fictional and suitable for testing only
  • Privacy - No personal data is collected, stored, or transmitted by this plugin
  • Local Processing - All data generation happens locally on your machine

⚠️ Note: While passwords generated by this tool use cryptographically secure methods, always follow your organization's security policies for production passwords.

πŸ™ Acknowledgements

  • Bogus - For generating realistic fake data
  • Microsoft PowerToys - For the amazing PowerToys Run platform
  • All Contributors - For their valuable contributions
  • Credit card numbers are fake and generated using standard test patterns
  • Do not use generated personal information for malicious purposes