Hash Function is a cryptographic algorithm that converts input data of any size into a fixed-length output (hash value) in a deterministic and irreversible manner.
Core Explanation (Exam-Focused)
-
Fixed-Length Output
Produces a hash of constant size regardless of input length.
-
Deterministic
Same input always results in the same hash.
-
One-Way Function
Original data cannot be derived from the hash.
-
Collision Resistance
Extremely difficult for two different inputs to produce the same hash.
-
Avalanche Effect
Small input change results in a completely different hash.
-
Fast Computation
Hashes are generated quickly for efficiency.
Role in Blockchain
-
Links blocks using previous block hash
-
Ensures data integrity of transactions
-
Used in mining and proof mechanisms
-
Forms Merkle trees
Common Hash Functions
-
SHA-256 – Bitcoin
-
Keccak-256 – Ethereum
Importance
One-Line Definition (Exam Use)
A hash function is a cryptographic algorithm that transforms data into a fixed-length, irreversible hash used to ensure integrity and security in blockchain systems.