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. Choose the correct answer from the options given below:
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. Choose the correct answer from the options given below: Correct Answer (A) and (C) only
The correct answer is option 3.
Key Points
A hash function is defined as any function that can be used to map data of the arbitrary size of data to fixed-size data.
Definition of hash function Statement 1 is correct and Statement 1 is incorrect.
A hash function may give the same hash value for distinct messages. Yes, it's true. If N%10 is a Hash function. It gives the same values for 101, 11,21,31 as 1.
Hence statement III is correct.
∴ Hence the correct answer is (A) and (C) only.