A comprehensive collection of useful developer tools built with PHP and modern web technologies.
Demo: https://roste.org/rand
Warning
Disclaimer: Please do not host this tool on a publicly accessible server. It most likely contains security vulnerabilities.
- Number generator
- String generator
- Image generator (built into this repository)
- QR Code generator
- ID generator
- Spin the wheel
- OpenSSL (AES encryption/decryption)
- Hashing (SHA512, SHA256, SHA1, MD5, and more)
- ROT cipher
- JWT inspector
- Private/public key tools
- SSH key generator
- CSR generator
- PEM/OpenSSH converter
- Crypto diagnostics
- Base converters
- Binary/hexadecimal
- URL encoding/decoding
- HTML entities encode/decode
- String tools (trim, reverse, shuffle, case conversion, etc.)
- Serialization (JSON, YAML, XML)
- Markdown editor (client-side live preview)
- Minify (CSS and JavaScript)
- Metaphone (phonetic key generation)
- Brainfuck converter
- Unit converter (volume, length, weight, temperature, energy, area, speed, time, power, data, pressure, angle)
- Currency converter
- DNS lookup (hostname/IP resolution)
- CIDR to IP range
- IP range to CIDR conversion
- Subnet mask calculator
- IP to hexadecimal converter
- Levenshtein distance (with tunable costs)
- Diff viewer (pure PHP, colorized output)
- Regex tester
- Calculator (basic arithmetic)
- Datetime tools (time unit conversion, timezone selector)
- Browser client inspector (capabilities, optional permissions/WebRTC/public IP probes)
- Crontab helper
- ShellCheck (shell script linting)
The published image and Dockerfile use PHP 8.5 with GMP, OpenSSH client (ssh-keygen), and the extensions listed in the Dockerfile.
# Pull latest image
docker pull darknetz/php-rand:latest
# Run container (replace 12345 with your desired port)
docker run -d -p 12345:80 --name php-rand darknetz/php-rand:latestservices:
phprand:
image: darknetz/php-rand:latest
container_name: php-rand
ports:
- "12345:80" # replace 12345 with your desired port
restart: unless-stopped# Clone repo
git clone https://github.com/Darknetzz/php-rand.git && cd php-rand
# Build image
docker build --no-cache -t php-rand .
# Run container (replace 12345 with your desired port)
docker run -d -p 12345:80 --name php-rand php-randRequirements:
- PHP 8.3+ with extensions: mbstring, mcrypt, gd, yaml, xml, gmp
- Web server (Apache, Nginx, etc.) with PHP support
- Composer (for dependency management)
# Install system dependencies (Ubuntu/Debian)
sudo apt install -y php8.3-common php8.3-mbstring php8.3-mcrypt php8.3-gd php8.3-yaml php8.3-xml php8.3-gmp
# Clone repository (assuming webroot is /var/www/html)
cd /var/www/html
git clone https://github.com/Darknetzz/php-rand.git
cd php-rand
# Install Composer dependencies
composer installOpen your browser and visit http://<webserver>/php-rand
For production deployments, enable HTTP compression and strong cache headers for static assets.
# Compression
gzip on;
gzip_comp_level 5;
gzip_min_length 1024;
gzip_vary on;
gzip_proxied any;
gzip_types text/plain text/css application/javascript application/json application/xml image/svg+xml;
# If ngx_brotli is installed:
brotli on;
brotli_comp_level 5;
brotli_types text/plain text/css application/javascript application/json application/xml image/svg+xml;
# Static assets: long cache
location ~* \.(?:css|js|png|jpg|jpeg|gif|svg|webp|ico|woff2?)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000, immutable";
}
# HTML/PHP responses: short/no cache
location ~* \.(?:html|php)$ {
add_header Cache-Control "no-cache, must-revalidate";
}<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain text/html text/css application/javascript application/json application/xml image/svg+xml
</IfModule>
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/plain text/html text/css application/javascript application/json application/xml image/svg+xml
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 30 days"
ExpiresByType application/javascript "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType image/svg+xml "access plus 30 days"
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(css|js|png|jpg|jpeg|gif|svg|webp|ico|woff|woff2)$">
Header set Cache-Control "public, max-age=2592000, immutable"
</FilesMatch>
<FilesMatch "\.(php|html)$">
Header set Cache-Control "no-cache, must-revalidate"
</FilesMatch>
</IfModule>Notes:
- Use content-hashed filenames (
app.abc123.js) for truly immutable caching. - Keep HTML dynamic/short-lived so new releases are discovered quickly.
For detailed documentation, feature guides, and implementation details, see:
- CHANGELOG - Version history and feature updates
- README - Detailed feature documentation
- IMPLEMENTATION_SUMMARY - Technical implementation details
- VISUAL_GUIDE - UI/UX design documentation
- RANDOM_BUTTON_FEATURE - Random data generation feature guide
Use the interactive release helper:
./scripts/release.sh 1.2.10What it does:
- rotates
CHANGELOG.mdfrom## [Unreleased]into## [vX.Y.Z] (YYYY-MM-DD) - recreates a fresh
Unreleasedtemplate - sets
VERSION=vX.Y.Zindocker-image.configso local Docker builds match the release - creates a release commit and annotated tag (
vX.Y.Z; commit includesCHANGELOG.mdanddocker-image.config) - optionally pushes branch + tag after an explicit confirmation prompt
- GitHub Release + Docker Hub / GHCR images: pushing the tag runs
.github/workflows/release.ymlanddocker-release.yml. You normally do not needghordocker-pushimage.shunless Actions are off or you want an immediate local registry push. - after a successful push, prompts (from
/dev/tty, not stdin) to rungh release createand./docker-pushimage.sh— default is Y (Enter accepts) so a normal push is not cut short aftergit - then prompts to merge
devintomainand push (default Y) so the default branch matches the release line; override branch names withRELEASE_BRANCH/MAIN_BRANCHif needed - if you already pushed the tag but skipped those steps:
./scripts/release.sh 1.2.10 --publish-only(includes the samegh, Docker, and merge prompts when run fromdev)
Why GitHub might still show an older “Latest” release: the badge uses GitHub Releases, not tags only. You need either a successful release.yml run on tag push or gh release create. If that step failed earlier, create the release with --publish-only or from the Releases UI.
Environment toggles:
CREATE_GH_RELEASE=1— after push, rungh release createwith changelog notes (skipped if the release already exists, e.g. CI created it first)PUBLISH_DOCKER=1— after push, run./docker-pushimage.sh(uses updateddocker-image.config; still uses your Docker Hub /.envcredentials)MERGE_RELEASE_TO_MAIN=1— after the above, mergedevintomainand push (non-interactive; combine with other toggles as needed)
Common options:
./scripts/release.sh --helpto show usage./scripts/release.sh 1.2.10 --dry-runto preview actions only./scripts/release.sh 1.2.10 --publish-onlyto run onlygh+ Docker after the tag is on the remote
Other release helpers (run from repo root):
-
scripts/extract_changelog_section.sh— Prints oneCHANGELOG.mdsection by heading title (from## <title>through the next## [line). Example:./scripts/extract_changelog_section.sh CHANGELOG.md "[v1.2.10]". Use--dry-runto verify the heading exists without printing the body. Requires ripgrep (rg) for--dry-run. -
scripts/update-release-descriptions.php— For each## [vX.Y.Z]block inCHANGELOG.md, runsgh release edit <tag> --notes-file …so existing GitHub Releases match the changelog (useful after editing old sections). Requires the GitHub CLI authenticated for this repo. Usephp scripts/update-release-descriptions.php --dry-runto list what would be updated without calling the API.
CI Docker publish requirements:
- Docker Hub secrets:
DOCKERHUB_USERNAMEandDOCKERHUB_TOKEN - GHCR publish uses
GITHUB_TOKENautomatically
- Digit mode supports up to 50 digits.
- For values above the native PHP integer range on the current server, generation uses GMP (including
gmp_prob_primefor primality). Supported large-digit types includeany,odd,even,palindromic,prime, andcomposite. squareandfibonaccistill require native integer ranges and are not available for digit ranges above that limit.
Automatic random data buttons for all input fields with context-aware detection:
- Calculator inputs get math expressions
- Networking fields get IP addresses or CIDR notation
- Email fields get email addresses
- And 20+ other context-specific generators
Full UTF-8 character encoding support across all modules for international text handling.
All functions include PHPDoc comments with descriptions, parameters, return types, and usage examples.
- Dark theme with gradient accents
- Responsive Bootstrap-based layout
- Split input/output designs
- Smooth animations and visual feedback
- Copy-to-clipboard functionality
- Backend: PHP 8.3+ with modular design (Docker image: PHP 8.5)
- Frontend: Vanilla JavaScript, jQuery, Bootstrap 5, Tabler UI
- Dependencies: Composer-managed (minify utilities)
- Extensible: Easy to add new tools by creating new modules
See LICENSE file in the repository.
For bugs, feature requests, or questions, please visit the GitHub repository.
