> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Hash String with SHA-256

> Hash a UTF-8 string using SHA-256 cryptographic hash function

Hash a UTF-8 string using SHA-256 cryptographic hash function

```typescript theme={null}
import { SHA256 } from '@tevm/voltaire/SHA256';
import { Hex } from '@tevm/voltaire/Hex';

// Hash a simple string
const message = "Hello, World!";
const hash = SHA256.hash(new TextEncoder().encode(message));
const hexHash = Hex.fromBytes(hash);

// Hash another string
const hash2 = SHA256.hash(new TextEncoder().encode("Voltaire"));
const hexHash2 = Hex.fromBytes(hash2);
```

<Tip>
  This is a fully executable example. View the complete source with test assertions at [`examples/hashing/sha256-hash.ts`](https://github.com/evmts/voltaire/blob/main/examples/hashing/sha256-hash.ts).
</Tip>

## Related

* [API Reference](/primitives)
* [More Examples](/examples)
