Hashing functions
A one-way function that turns any input into a fixed-length value. The same input always gives the same hash, a tiny change gives a very different one, and it cannot be reversed.
Understanding Hashing functions in VCE Data Analytics U4O2
What it does: Changing just one character produces a very different hash, so the two hash values are not equal. A one-letter input and a huge file both give a hash of the same length, so the lengths are equal. Hashing is one-way. Unlike encryption, there is no key that turns the hash back into the input. Encryption is designed to be decrypted by someone with the key. Hashing is not designed to be reversed. Hash functions are one-way, so there is no way to run them backwards. Hashing is deterministic: identical inputs always produce identical hashes, which is how hashes are used to check data.
Common mistakes: The program is checking that the same input gives the same hash. Changing 'cat' to 'Cat' changes the input, so the hashes would differ. Line 2 should hash "cat" again. A hash function always gives a fixed-length output, whatever the input size. The two hashes have equal lengths, so the test should be LEN(h1) = LEN(h2), not <.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 44–79) and word search (Modules 44–113).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
hash functionFill in the Blanks
Spot the Error
Student with a class code? Join your class →