# Hash Generator — Algorithm Guides, Use-Case Guides, Definitions, Conversions, Hardware Keys For the full tool, see: [https://capytoolkit.com/tools/developer/hash-generator/](https://capytoolkit.com/tools/developer/hash-generator/) ## Code Examples [SHA-256 in Python](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha256-python): How to compute SHA-256 hashes in Python using hashlib. String encoding, file hashing, and HMAC with digestmod examples. Standard library, no dependencies. [SHA-256 in JavaScript (Web Crypto API)](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha256-javascript): Compute SHA-256 hashes in JavaScript using the browser's built-in Web Crypto API. Async TextEncoder pattern, hex output, and file hashing with ArrayBuffer. [SHA-256 in Java](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha256-java): Compute SHA-256 hashes in Java using MessageDigest. String encoding, file streaming, hex conversion, and byte array handling. Standard library, no dependencies. [SHA-256 in PHP](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha256-php): How to compute SHA-256 in PHP using the hash() and hash_file() functions. HMAC with hash_hmac(), raw binary vs hex output, and timing-safe comparison. [SHA-256 in Go](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha256-go): How to compute SHA-256 in Go using the crypto/sha256 package. One-shot Sum256, streaming io.Writer interface, hex encoding, and file hashing patterns. [SHA-256 in Node.js](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha256-nodejs): Compute SHA-256 hashes in Node.js using the built-in crypto module. createHash, pipe-based file hashing, HMAC, and streams. No npm packages required. [SHA-256 in C#](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha256-csharp): Compute SHA-256 hashes in C# using SHA256.HashData or SHA256.Create. String encoding, file streaming, HMAC, and hex conversion with .NET 5+ and .NET Framework. [MD5 in Python](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#md5-python): How to compute MD5 hashes in Python using hashlib. When MD5 is acceptable, its known vulnerabilities, file checksums, and the usedforsecurity flag in Python 3.9+. [MD5 in PHP](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#md5-php): How to compute MD5 hashes in PHP using md5() and hash("md5"). File checksums, when to use MD5 vs SHA-256, and timing-safe comparison with hash_equals(). [MD5 in JavaScript](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#md5-javascript): How to compute MD5 in JavaScript using js-md5. Why SubtleCrypto excludes MD5, file hashing, and when to use SHA-256 instead. [SHA-512 in Python](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha512-python): How to compute SHA-512 hashes in Python using hashlib. 128-char hex output, truncated variants SHA-512/256, file streaming, and when to choose SHA-512 over SHA-256. [SHA-512 in Node.js](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha512-nodejs): Compute SHA-512 hashes in Node.js using the built-in crypto module. createHash, HMAC-SHA512, streaming, and when SHA-512 is faster than SHA-256. [SHA-1 in Python](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#sha1-python): How to compute SHA-1 hashes in Python using hashlib. Known collision vulnerabilities, why Git uses SHA-1, the SHAttered attack, and migration to SHA-256. [HMAC-SHA256 in Python](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#hmac-sha256-python): How to compute HMAC-SHA256 in Python using the hmac module. Webhook verification, constant-time comparison, key encoding, and Python 3 API patterns. [HMAC-SHA256 in JavaScript (Web Crypto API)](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#hmac-sha256-javascript): How to compute HMAC-SHA256 in browser JavaScript using SubtleCrypto. importKey, sign, hex output, and webhook signature verification patterns. [HMAC-SHA256 in Node.js](https://capytoolkit.com/tools/developer/hash-generator/code-examples/#hmac-sha256-nodejs): Compute HMAC-SHA256 in Node.js using crypto.createHmac. Webhook verification (GitHub, Stripe), timingSafeEqual, streaming updates, and Express middleware pattern. ## Use-Case Guides [File Integrity Verification with SHA-256](https://capytoolkit.com/tools/developer/hash-generator/file-integrity-check/): How SHA-256 detects file corruption and tampering. Checksum workflow, hash-file comparison, command-line verification, and download verification patterns. [Verifying Webhook Signatures with HMAC-SHA256](https://capytoolkit.com/tools/developer/hash-generator/webhook-signature-verification/): How to verify HMAC-SHA256 webhook signatures from GitHub and Stripe. Raw body requirement, timing-safe comparison, and provider header patterns. [Signing API Requests with HMAC-SHA256](https://capytoolkit.com/tools/developer/hash-generator/api-request-signing/): How to sign API requests using HMAC-SHA256. AWS Signature Version 4, canonical request construction, Authorization header, and replay attack prevention. [How Git Uses SHA-1 and SHA-256 for Object IDs](https://capytoolkit.com/tools/developer/hash-generator/git-object-hashing/): How Git computes object IDs for blobs, trees, commits, and tags using SHA-1 and SHA-256. The header format, transition plan, and collision risk in practice. [Choosing the Right Hash Algorithm in 2026](https://capytoolkit.com/tools/developer/hash-generator/choose-hash-algorithm-2026/): SHA-256 vs SHA-512 vs MD5 vs SHA-1 comparison for 2026. Security status, performance, use cases, and NIST recommendations for modern applications. ## Hash Generator Reference [What Is SHA-256?](https://capytoolkit.com/tools/developer/hash-generator/reference/#what-is-sha-256): SHA-256 definition: a 256-bit cryptographic hash function from the SHA-2 family, standardized in NIST FIPS 180-4. Output length, security status, and use cases. [What Is MD5?](https://capytoolkit.com/tools/developer/hash-generator/reference/#what-is-md5): MD5 definition: a 128-bit legacy hash function with known collision vulnerabilities. Security status, when MD5 is still acceptable, and why it was replaced by SHA-256. [What Is HMAC?](https://capytoolkit.com/tools/developer/hash-generator/reference/#what-is-hmac): HMAC definition: a message authentication code that combines a hash function with a secret key, defined in RFC 2104. Security properties, how it works, and use cases. [Hash vs Encryption](https://capytoolkit.com/tools/developer/hash-generator/reference/#hash-vs-encryption): Hash vs encryption: one-way vs reversible, fixed vs variable output, no key vs key required. SHA-256, AES, and when to use each. Common misconceptions clarified. ## Hash Generator: Conversions [hash bits to hex characters](https://capytoolkit.com/tools/developer/hash-generator/conversions/#hash-bits-to-hex-characters): Convert hash bits to hex characters for MD5, SHA-1, SHA-256, SHA-384, and SHA-512 digests. [hash bits to base64 characters](https://capytoolkit.com/tools/developer/hash-generator/conversions/#hash-bits-to-base64-characters): Convert hash bits to base64 characters for MD5, SHA-1, SHA-256, SHA-384, and SHA-512 digests. ## Hardware [Yubico YubiKey 5 NFC](https://capytoolkit.com/tools/developer/hash-generator/yubikey-5-nfc/): YubiKey 5 NFC hardware security key: HMAC-SHA1 challenge-response, FIDO2 WebAuthn, OTP modes, USB-A and NFC connectivity. Use cases and specs. [Thetis Thetis Pro FIDO2](https://capytoolkit.com/tools/developer/hash-generator/thetis-pro-fido2/): Thetis Pro FIDO2 hardware key: dual USB-A/C connector, NFC, FIDO2 WebAuthn, and SHA-256 in authentication assertions. Budget security key specs and use cases. [Nitrokey Nitrokey 3](https://capytoolkit.com/tools/developer/hash-generator/nitrokey-3/): Nitrokey 3 hardware security key: open-source hardware and Rust firmware, FIDO2, OpenPGP, PIV, HMAC-SHA256 via Trussed. Specs and use cases for developers. [Feitian ePass FIDO2](https://capytoolkit.com/tools/developer/hash-generator/feitian-epass-fido2/): Feitian ePass FIDO2 hardware key: FIPS 140-2 Level 2 certification, SHA-256 in WebAuthn assertions, US government use cases. Specs and comparison at ~$25 USD.