Back to course

Cryptography: Hashing in Rust

Rust for Systems & Web3 Security

Protecting Data Integrity

Cryptography is the backbone of Web3. We use crates like sha2 to generate hashes.

rust use sha2::{Sha256, Digest};

let mut hasher = Sha256::new(); hasher.update(b"hello world"); let result = hasher.finalize();

You'll learn how to verify data using hashes, the first step in building a blockchain.