You are developing a method to hash data for later verification by using the MD5 algorithm.

You are developing a method to hash data for later verification by using the MD5 algorithm. The
data is passed to your method as a byte array named message. You need to compute the hash
of the incoming parameter by using MD5. You also need to place the result into a byte array.
Which code segment should you use?

A. HashAlgorithm ^algo = HashAlgorithm::Create(“MD5”);hash = algo-
>CompueHash(message);
B. HashAlgorithm ^algo = HashAlgorithm::Create(“MD5”);hash = BitConverter::GetBytes(algo-
>GetHashCode());
C. HashAlgorithm ^algo;algo = HashAlgorithm::Create(message->ToString());hash = algo-
>Hash;
D. HashAlgorithm ^algo = HashAlgorithm::Create(“MD5”);hash = nullptr;algo-
>TransformBlock(message, 0, message->Length, hash, 0);

Answer: A

No comments:

Post a Comment