Hash Generator on Selection
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
This script adds a floating button that appears when you select text, allowing you to instantly generate cryptographic hash digests of the selected content. It supports SHA-1, SHA-256, SHA-384, and SHA-512 algorithms using the browser's native SubtleCrypto API. The popup displays all four hashes simultaneously, with hex and Base64 output options. You can copy individual hashes, copy all hashes, or replace the original selection with the hash of your chosen algorithm. Perfect for developers verifying file integrity, generating API tokens, or comparing checksums.
WHERE IT RUNS
The script works on any page with selectable text—API documentation, code snippets, log files, configuration files, and any page containing text that needs hashing. It works on any website, adding a lightweight tool for quick hash generation without leaving your page.
HOW TO USE
After installation, select any text on a page. A floating # button appears near your selection. Click it to generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes of the selected text. The results appear in a popup showing each algorithm with its hash value. From the popup, you can copy individual hashes by clicking the algorithm buttons (e.g., "1" for SHA-1, "256" for SHA-256), copy all hashes with the "Copy All" button, or replace the original selection with the hash from your default algorithm. Use the keyboard shortcut Ctrl+Shift+H to hash the current selection. Open the panel to customize: show/hide the floating button, choose button position, set the default algorithm, show/hide the popup, enable replace-on-generate, and select output format (hex or base64).
TECHNICAL MECHANISM
The script uses a multi-stage hash generation pipeline powered by the Web Crypto API. First, it captures text selection using the Selection API, detecting when the user selects text and determining the selection's bounding rectangle for button positioning. Second, it encodes the selected text using TextEncoder to convert it to a Uint8Array. Third, it uses `crypto.subtle.digest()` to generate hashes for each algorithm: SHA-1, SHA-256, SHA-384, and SHA-512. These operations are asynchronous and run in parallel using Promise.all for performance. Fourth, it converts the resulting ArrayBuffer to hex or base64 format using `Uint8Array` and `btoa()`. Fifth, it displays all hashes in a floating popup with algorithm labels and copy buttons. The script uses position tracking to place the button and popup near the selection.
THE PANEL
The settings panel is fully draggable and can be positioned anywhere on your screen. It automatically snaps to the nearest edge when released, keeping your workspace organized. The panel can be collapsed to a small bubble showing only a gear icon, and restored with a single click. Its position is remembered across page reloads using GM_setValue. The panel also responds to the Escape key, which instantly hides it until you click the bubble again. All settings are saved immediately when changed and persist across browser sessions.
PLEASE NOTE
This script requires the free BotGentz extension to run. Hash generation uses the browser's built-in SubtleCrypto API and is not supported on very old browsers. SHA-1 is provided for compatibility but is not recommended for security-sensitive applications. The script does not access, store, or transmit any personal data or browsing history. All processing happens locally in your browser and never leaves your device.