Which code segment should you use?

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?

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.
Dim objAlgo As HashAlgorithm = HashAlgorithm.Create(“MD5”)Dim hash() As Byte = objAlgo.ComputeHash(message)

B.
Dim objAlgo As HashAlgorithm = HashAlgorithm.Create(“MD5”)Dim hash() As Byte = BitConverter.GetBytes(objAlgo.GetHashCode)

C.
Dim objAlgo As HashAlgorithmobjAlgo = HashAlgorithm.Create(message.ToString)Dim hash() As Byte = objAlgo.Hash

D.
Dim objAlgo As HashAlgorithm = HashAlgorithm.Create(“MD5”)Dim hash() As ByteobjAlgo.TransformBlock(message, 0, message.Length, hash, 0)



Leave a Reply 0

Your email address will not be published. Required fields are marked *