Qraft

Hash

A hash function converts input data of any length into a fixed-length output (hash value or digest). The same input always produces the same hash, but reversing the process is computationally infeasible (one-way property). Even a single-bit input change dramatically alters the output (avalanche effect). SHA-256 and SHA-3 are widely used algorithms.

Hashes serve multiple roles around QR codes. In QR code payments, transaction data hashes combined with digital signatures detect tampering. The EU Digital COVID Certificate hashed vaccination data, signed the hash, and stored it in QR codes.

TOTP (one-time password) generation also relies on hashing. The secret key and current time are processed through HMAC-SHA1 to derive a 6-digit authentication code - QR codes transfer the secret key, hash functions generate the codes.

Checksums are conceptually related. QR code format and version information use BCH codes for integrity verification - the same principle of "verifying data correctness with a short value" runs from QR code internals through the application layer.