# common Runtime-agnostic helpers that work identically in browser and Node.js without touching any platform crypto API. ## Overview The common entry point is reserved for utilities that are pure functions over plain values and therefore have no need to be split per-runtime. Today it exposes a single SHA-256 hash-string validator. Algorithm implementations, key derivation, and the vault live in the platform-specific [`/browser`](https://www.hyperfrontend.dev/docs/libraries/cryptography/browser.md) and [`/node`](https://www.hyperfrontend.dev/docs/libraries/cryptography/node.md) entry points because they require a `SubtleCrypto` and secure RNG. ## Usage ```typescript import { isSHA256Hash } from '@hyperfrontend/cryptography/common' isSHA256Hash('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855') // true isSHA256Hash('not-a-hash') // false ``` Use this entry point in code that runs in both environments (shared types, isomorphic validators, framework-agnostic packages) to avoid pulling a platform adapter into the bundle. ## API Reference ### Functions #### isSHA256Hash ```typescript function isSHA256Hash(hash: unknown): boolean ``` Validates whether the provided value is a valid SHA-256 hash string. Checks for exactly 64 hexadecimal characters (case-insensitive). **Parameters** | Name | Type | Description | | --- | --- | --- | | `hash` | `unknown` | The value to validate as a SHA-256 hash | **Returns** `boolean`: True if the value is a valid SHA-256 hash string, false otherwise **Example: Validating SHA-256 hashes** ```typescript isSHA256Hash('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855') // => true isSHA256Hash('invalid') // => false ``` --- Canonical page: https://www.hyperfrontend.dev/docs/libraries/cryptography/common/ This file: https://www.hyperfrontend.dev/docs/libraries/cryptography/common.md Documentation index: https://www.hyperfrontend.dev/llms.txt