Dark Mode

1,718 views

0 votes

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

- A hash function takes a message of arbitrary length and generates a fixed length code
- A hash function takes a message of fixed length and generates a code of variable length
- A hash function may give same hash value for distinct messages

Choose the correct answer from the options given below:

- $(a)$ only
- $(b)$ and $(c)$ only
- $(a)$ and $(c)$ only
- $(b)$ only

0 votes

Answer is (**C**).

- A hash function takes a message of arbitrary length and generates a fixed length code.
**This is correct**, this is directly from definition of hash function. Ref: https://en.wikipedia.org/wiki/Hash_function

- As I is correct
**II is wrong**.

**This is true**. eg: Hash function N%8, this will generate same values for 1 as well as 9.

(Even in cryptographic hash functions collision happens, just that it is not easy to find colliding instances).

0 votes

A **hash function** is any function that can be used to map data of arbitrary size to fixed-size values. The values returned by a hash function are called *hash values*, *hash codes*, *digests*, or simply *hashes*. The values are usually used to index a fixed-size table called a *hash table*. Use of a hash function to index a hash table is called *hashing* or *scatter storage addressing*.

option **c**