You are developing a method named GetHash that will return a hash value for a file. The method includes the following code. (Line numbers are included for reference only.)
You need to return the cryptographic hash of the bytes contained in the fileBytes variable.
Which code segment should you insert at line 05?
A. Option A
B. Option B
C. Option C
D. Option D
definitely answer D
public byte[] ComputeHash(byte[] buffer, int offset, int count);
// Summary:
// Computes the hash value for the specified byte array.
should be D
Only correct answer is D. Tested in VS.
Solution A fails on: hasher.TransformFinalBlock(fileBytes, fileBytes.Length – 1, fileBytes.Length);
https://msdn.microsoft.com/en-us/library/system.security.cryptography.hashalgorithm.transformblock(v=vs.110).aspx
Both methods work fine, but as we don’t need to hash any special blocks in the message, we shall use the simpler method -> D.
most people say D : https://msdn.microsoft.com/en-us/library/s02tk69a(v=vs.110).aspx