Which code segment should you insert at line 05?

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?

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



Leave a Reply 9

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


Vidmanas

Vidmanas

I think it is “D”. Because A. Hash is calculated two times. It return same fileBytes array only copyed to another array

harsh

harsh

The correct answer is A

ici

ici

D

Najlepszy Programista

Najlepszy Programista

A you bi

Artem

Artem

If A correct then C must too. Because third line in A does not modify the “outputBuffer”. If the third line in A does not throw Exception, then A and C is identic.

zeti

zeti

A would work if

signatureAlgo.TransformBlock(fileBuffer, 0, fileBuffer.Length – 1, fileBuffer, 0);
signatureAlgo.TransformFinalBlock(fileBuffer, fileBuffer.Length -1, 1);
return signatureAlgo.Hash;

so its D