PREMIUM
Join our WhatsApp Channel
Daily MCQs, Past Papers & Jobs for PPSC, FPSC, CSS
Daily MCQs • Past Papers • Jobs for PPSC, FPSC, CSS
Join Channel

In cryptography and data structures, what is the primary purpose of a hash function?

A. Compressing large video files into MP4 format
B. Increasing the clock speed of a microprocessor
C. Verifying data integrity and enabling fast lookup
D. Converting analog audio signals into digital waves
Correct Answer: C. Verifying data integrity and enabling fast lookup

Correct answer: Verifying data integrity and enabling fast lookup.

Background: A hash function maps input data of any size to a fixed-size hash value, which is used to check that data has not changed (integrity) and to find data quickly in hash tables.

  • Compressing large video files into MP4 format: is the job of a video codec, not a hash function.
  • Increasing the clock speed of a microprocessor: is a hardware setting, unrelated to hashing.
  • Converting analog audio signals into digital waves: is the job of an analog-to-digital converter, not a hash function.

Did you know? The same input always gives the same hash, so even a one-bit change produces a completely different hash value.

Memory trick: Hash = fingerprint — it checks the data and finds it fast.

0 comments

Leave a Reply

Join Our WhatsApp Channel ×