{"id":43993937,"url":"https://github.com/darknetzz/php-rand","last_synced_at":"2026-07-06T05:00:35.434Z","repository":{"id":184331394,"uuid":"144974761","full_name":"Darknetzz/php-rand","owner":"Darknetzz","description":"php-rand","archived":false,"fork":false,"pushed_at":"2026-07-02T09:10:34.000Z","size":17772,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2026-07-02T11:05:33.614Z","etag":null,"topics":["generator","number","password","password-generator","php","prime-numbers","qrcode-generator","random","string"],"latest_commit_sha":null,"homepage":"https://rand.demo.roste.org/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Darknetzz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2018-08-16T10:45:30.000Z","updated_at":"2026-07-02T09:10:38.000Z","dependencies_parsed_at":"2023-10-16T23:59:26.562Z","dependency_job_id":"f985764f-65f7-4ade-b93c-1550af3aacd8","html_url":"https://github.com/Darknetzz/php-rand","commit_stats":null,"previous_names":["darknetzz/phprand","darknetzz/php-rand"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/Darknetzz/php-rand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darknetzz%2Fphp-rand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darknetzz%2Fphp-rand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darknetzz%2Fphp-rand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darknetzz%2Fphp-rand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Darknetzz","download_url":"https://codeload.github.com/Darknetzz/php-rand/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darknetzz%2Fphp-rand/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35178403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generator","number","password","password-generator","php","prime-numbers","qrcode-generator","random","string"],"created_at":"2026-02-07T11:09:00.774Z","updated_at":"2026-07-06T05:00:35.396Z","avatar_url":"https://github.com/Darknetzz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phprand\n\nA comprehensive collection of useful developer tools built with PHP and modern web technologies.\n\n**Demo:** [https://rand.demo.roste.org/](https://rand.demo.roste.org/)\n\n\u003e [!WARNING]  \n\u003e Disclaimer: Please do not host this tool on a publicly accessible server. It most likely contains security vulnerabilities.\n\n![Rand](images/image2.png)\n\n## Features\n\n### Generators\n- Number generator\n- String generator\n- Image generator (built into this repository)\n- QR Code generator\n- ID generator\n- Spin the wheel\n\n### Cryptography\n- OpenSSL (AES encryption/decryption)\n- Hashing (SHA512, SHA256, SHA1, MD5, and more)\n- ROT cipher\n- JWT inspector\n- Private/public key tools\n- SSH key generator\n- CSR generator\n- PEM/OpenSSH converter\n- Crypto diagnostics\n\n### Encoding \u0026 Decoding\n- Base converters\n- Binary/hexadecimal\n- URL encoding/decoding\n- HTML entities encode/decode\n\n### Text \u0026 Data\n- String tools (trim, reverse, shuffle, case conversion, etc.)\n- Serialization (JSON, YAML, XML)\n- Markdown editor (client-side live preview)\n- Minify (CSS and JavaScript)\n- Metaphone (phonetic key generation)\n- Brainfuck converter\n- Unit converter (volume, length, weight, temperature, energy, area, speed, time, power, data, pressure, angle)\n- Currency converter\n\n### Networking\n- DNS lookup (hostname/IP resolution)\n- CIDR to IP range\n- IP range to CIDR conversion\n- Subnet mask calculator\n- IP to hexadecimal converter\n\n### Comparison \u0026 Analysis\n- Levenshtein distance (with tunable costs)\n- Diff viewer (pure PHP, colorized output)\n- Regex tester\n\n### Miscellaneous\n- Calculator (basic arithmetic)\n- Datetime tools (time unit conversion, timezone selector)\n- Browser client inspector (capabilities, optional permissions/WebRTC/public IP probes)\n- Crontab helper\n- ShellCheck (shell script linting)\n\n## Installation\n\n### Docker (Recommended)\n\nThe published image and `Dockerfile` use **PHP 8.5** with **GMP**, **OpenSSH client** (`ssh-keygen`), and the extensions listed in the Dockerfile.\n\n#### Pull from Docker Hub\n```bash\n# Pull latest stable image (release tags)\ndocker pull darknetz/php-rand:latest\n\n# Pull rolling dev image (updated on every push to dev)\ndocker pull darknetz/php-rand:dev\n# alias: darknetz/php-rand:develop\n\n# Run container (replace 12345 with your desired port)\ndocker run -d -p 12345:80 --name php-rand darknetz/php-rand:latest\n```\n\n#### Docker Compose\n```yaml\nservices:\n  phprand:\n    image: darknetz/php-rand:latest\n    container_name: php-rand\n    ports:\n      - \"12345:80\"  # replace 12345 with your desired port\n    restart: unless-stopped\n```\n\n#### Build from Dockerfile\n```bash\n# Clone repo\ngit clone https://github.com/Darknetzz/php-rand.git \u0026\u0026 cd php-rand\n\n# Build image\ndocker build --no-cache -t php-rand .\n\n# Run container (replace 12345 with your desired port)\ndocker run -d -p 12345:80 --name php-rand php-rand\n```\n\n### Manual Installation (Without Docker)\n\nRequirements:\n- PHP 8.3+ with extensions: mbstring, mcrypt, gd, yaml, xml, gmp\n- Web server (Apache, Nginx, etc.) with PHP support\n- Composer (for dependency management)\n\n```bash\n# Install system dependencies (Ubuntu/Debian)\nsudo apt install -y php8.3-common php8.3-mbstring php8.3-mcrypt php8.3-gd php8.3-yaml php8.3-xml php8.3-gmp\n\n# Clone repository (assuming webroot is /var/www/html)\ncd /var/www/html\ngit clone https://github.com/Darknetzz/php-rand.git\ncd php-rand\n\n# Install Composer dependencies\ncomposer install\n```\n\nOpen your browser and visit `http://\u003cwebserver\u003e/php-rand`\n\n## Production Performance Guidance\n\nFor production deployments, enable HTTP compression and strong cache headers for static assets.\n\n### Nginx (gzip + brotli + cache headers)\n\n```nginx\n# Compression\ngzip on;\ngzip_comp_level 5;\ngzip_min_length 1024;\ngzip_vary on;\ngzip_proxied any;\ngzip_types text/plain text/css application/javascript application/json application/xml image/svg+xml;\n\n# If ngx_brotli is installed:\nbrotli on;\nbrotli_comp_level 5;\nbrotli_types text/plain text/css application/javascript application/json application/xml image/svg+xml;\n\n# Static assets: long cache\nlocation ~* \\.(?:css|js|png|jpg|jpeg|gif|svg|webp|ico|woff2?)$ {\n    expires 30d;\n    add_header Cache-Control \"public, max-age=2592000, immutable\";\n}\n\n# HTML/PHP responses: short/no cache\nlocation ~* \\.(?:html|php)$ {\n    add_header Cache-Control \"no-cache, must-revalidate\";\n}\n```\n\n### Apache (.htaccess or vhost)\n\n```apache\n\u003cIfModule mod_deflate.c\u003e\n  AddOutputFilterByType DEFLATE text/plain text/html text/css application/javascript application/json application/xml image/svg+xml\n\u003c/IfModule\u003e\n\n\u003cIfModule mod_brotli.c\u003e\n  AddOutputFilterByType BROTLI_COMPRESS text/plain text/html text/css application/javascript application/json application/xml image/svg+xml\n\u003c/IfModule\u003e\n\n\u003cIfModule mod_expires.c\u003e\n  ExpiresActive On\n  ExpiresByType text/css \"access plus 30 days\"\n  ExpiresByType application/javascript \"access plus 30 days\"\n  ExpiresByType image/png \"access plus 30 days\"\n  ExpiresByType image/jpeg \"access plus 30 days\"\n  ExpiresByType image/svg+xml \"access plus 30 days\"\n\u003c/IfModule\u003e\n\n\u003cIfModule mod_headers.c\u003e\n  \u003cFilesMatch \"\\.(css|js|png|jpg|jpeg|gif|svg|webp|ico|woff|woff2)$\"\u003e\n    Header set Cache-Control \"public, max-age=2592000, immutable\"\n  \u003c/FilesMatch\u003e\n  \u003cFilesMatch \"\\.(php|html)$\"\u003e\n    Header set Cache-Control \"no-cache, must-revalidate\"\n  \u003c/FilesMatch\u003e\n\u003c/IfModule\u003e\n```\n\nNotes:\n- Use content-hashed filenames (`app.abc123.js`) for truly immutable caching.\n- Keep HTML dynamic/short-lived so new releases are discovered quickly.\n\n## Documentation\n\nFor detailed documentation, feature guides, and implementation details, see:\n- [CHANGELOG](CHANGELOG.md) - Version history and feature updates\n- [README](docs/README.md) - Detailed feature documentation\n- [IMPLEMENTATION_SUMMARY](docs/IMPLEMENTATION_SUMMARY.md) - Technical implementation details\n- [VISUAL_GUIDE](docs/VISUAL_GUIDE.md) - UI/UX design documentation\n- [RANDOM_BUTTON_FEATURE](docs/RANDOM_BUTTON_FEATURE.md) - Random data generation feature guide\n\n## Release Workflow\n\nUse the interactive release helper:\n\n```bash\n./scripts/release.sh 1.2.10\n```\n\nWhat it does:\n- rotates `CHANGELOG.md` from `## [Unreleased]` into `## [vX.Y.Z] (YYYY-MM-DD)`\n- recreates a fresh `Unreleased` template\n- sets `VERSION=vX.Y.Z` in `docker-image.config` so local Docker builds match the release\n- creates a release commit and annotated tag (`vX.Y.Z`; commit includes `CHANGELOG.md` and `docker-image.config`)\n- optionally pushes branch + tag after an explicit confirmation prompt\n- **GitHub Release + Docker Hub / GHCR images:** pushing the tag runs `.github/workflows/release.yml` and `docker-release.yml`. You normally do **not** need `gh` or `docker-pushimage.sh` unless Actions are off or you want an immediate local registry push.\n- after a successful push, prompts (from `/dev/tty`, not stdin) to run `gh release create` and `./docker-pushimage.sh` — default is **Y** (Enter accepts) so a normal push is not cut short after `git`\n- then prompts to **merge `dev` into `main` and push** (default **Y**) so the default branch matches the release line; override branch names with `RELEASE_BRANCH` / `MAIN_BRANCH` if needed\n- if you already pushed the tag but skipped those steps: `./scripts/release.sh 1.2.10 --publish-only` (includes the same `gh`, Docker, and merge prompts when run from `dev`)\n\n**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.\n\nEnvironment toggles:\n- `CREATE_GH_RELEASE=1` — after push, run `gh release create` with changelog notes (skipped if the release already exists, e.g. CI created it first)\n- `PUBLISH_DOCKER=1` — after push, run `./docker-pushimage.sh` (uses updated `docker-image.config`; still uses your Docker Hub / `.env` credentials)\n- `MERGE_RELEASE_TO_MAIN=1` — after the above, merge `dev` into `main` and push (non-interactive; combine with other toggles as needed)\n\nCommon options:\n- `./scripts/release.sh --help` to show usage\n- `./scripts/release.sh 1.2.10 --dry-run` to preview actions only\n- `./scripts/release.sh 1.2.10 --publish-only` to run only `gh` + Docker after the tag is on the remote\n\nOther release helpers (run from repo root):\n\n- **`scripts/extract_changelog_section.sh`** — Prints one `CHANGELOG.md` section by heading title (from `## \u003ctitle\u003e` through the next `## [` line). Example: `./scripts/extract_changelog_section.sh CHANGELOG.md \"[v1.2.10]\"`. Use `--dry-run` to verify the heading exists without printing the body. Requires [ripgrep](https://github.com/BurntSushi/ripgrep) (`rg`) for `--dry-run`.\n\n- **`scripts/update-release-descriptions.php`** — For each `## [vX.Y.Z]` block in `CHANGELOG.md`, runs `gh release edit \u003ctag\u003e --notes-file …` so existing GitHub Releases match the changelog (useful after editing old sections). Requires the [GitHub CLI](https://cli.github.com/) authenticated for this repo. Use `php scripts/update-release-descriptions.php --dry-run` to list what would be updated without calling the API.\n\nCI Docker publish requirements:\n- Docker Hub secrets: `DOCKERHUB_USERNAME` and `DOCKERHUB_TOKEN`\n- GHCR publish uses `GITHUB_TOKEN` automatically\n- **Release images** (`latest`, `vX.Y.Z`): pushed on `v*` tags via `docker-release.yml`\n- **Dev images** (`dev`, `develop`): republished on every push to `dev` via `docker-dev.yml` (rolling tags only)\n\n## Key Features\n\n### Number Generator Notes\n\n- Digit mode supports up to 50 digits.\n- For values above the native PHP integer range on the current server, generation uses **GMP** (including `gmp_prob_prime` for primality). Supported large-digit types include `any`, `odd`, `even`, `palindromic`, `prime`, and `composite`.\n- `square` and `fibonacci` still require native integer ranges and are not available for digit ranges above that limit.\n\n### 🎲 Smart Random Data Generation\nAutomatic random data buttons for all input fields with context-aware detection:\n- Calculator inputs get math expressions\n- Networking fields get IP addresses or CIDR notation\n- Email fields get email addresses\n- And 20+ other context-specific generators\n\n### 🌍 UTF-8 Support\nFull UTF-8 character encoding support across all modules for international text handling.\n\n### 📚 Comprehensive Documentation\nAll functions include PHPDoc comments with descriptions, parameters, return types, and usage examples.\n\n### 🎨 Modern UI/UX\n- Dark theme with gradient accents\n- Responsive Bootstrap-based layout\n- Split input/output designs\n- Smooth animations and visual feedback\n- Copy-to-clipboard functionality\n\n## Architecture\n\n- **Backend:** PHP 8.3+ with modular design (Docker image: PHP 8.5)\n- **Frontend:** Vanilla JavaScript, jQuery, Bootstrap 5, Tabler UI\n- **Dependencies:** Composer-managed (minify utilities)\n- **Extensible:** Easy to add new tools by creating new modules\n\n## License\n\nSee LICENSE file in the repository.\n\n## Support\n\nFor bugs, feature requests, or questions, please visit the [GitHub repository](https://github.com/Darknetzz/php-rand).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarknetzz%2Fphp-rand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarknetzz%2Fphp-rand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarknetzz%2Fphp-rand/lists"}