All mock tests are FREE till 31 December — register to save your progress

Which among the following statement(s) is (are) true?

(A) A hash function takes a message of arbitrary length and generates a fixed length code.

(B) A hash function takes a message of fixed length and generates a code of variable length.

(C) A hash function may give same hash value for distinct messages.

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. (A) and (C) only

Explanation

A hash maps input of any length to a fixed-length digest (A), and since inputs outnumber outputs, distinct messages can collide (C). B reverses fixed and variable length.

More Data Communication and Computer Networks questions