What it does
The hash generator component provides a text input area where users can type or paste content. The hash is computed in real time using the browser's built-in Web Crypto API and displayed in the output area below. A copy button in the header lets users quickly copy the hash to their clipboard.
The algorithm selector allows switching between SHA-1, SHA-256, SHA-384, and SHA-512 variants.
Composition and API
Pass the algorithm via the algorithm prop (default sha256). The component supports controlled mode via value and onValueChange props, as well as uncontrolled usage with internal state. The readOnly prop disables editing, and showCopyButton controls the visibility of the copy button.
Common use cases
The hash generator is ideal for developer tooling panels, security dashboards, password management interfaces, and educational tools where users need to compute cryptographic hashes without leaving the browser.
Accessibility
The component uses semantic HTML elements including textarea for input and proper labels. The copy button provides clear visual feedback when the hash is copied. Keyboard order and focus management should match production usage.
This preview page exposes a single h1 in the hero for a clean outline.
Next.js integration notes
Colocate examples under the App Router, keep server and client boundaries explicit, and avoid pulling interactive components into unexpected server layouts.
Set NEXT_PUBLIC_SITE_URL so canonical and Open Graph URLs resolve on deploy.
FAQ
Does the Hash Generator component work with Next.js App Router?
Yes. Import it like any other React component; the component uses client-side state and the Web Crypto API and works seamlessly with server components when used as a client boundary.
Can I customize the hash generator with Tailwind CSS?
Zentauri UI exposes class-friendly variants and slots so you can extend styles with Tailwind utilities without fighting inline styles.
What algorithms are supported?
The component supports SHA-1, SHA-256, SHA-384, and SHA-512 via the Web Crypto API. MD5 is not supported as it is not part of the Web Crypto specification and is considered cryptographically broken.
Is the input data sent to a server?
No. All hashing is performed client-side using the browser's built-in Web Crypto API. No data is transmitted to any server.