exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 132 discussion

Actual exam question from Microsoft's 70-483
Question #: 132
Topic #: 2
[All 70-483 Questions]

DRAG DROP -
You have the following code.
string MessageString = "This is the original message!";
You need to store the SHA1 hash value of MessageString in a variable named HashValue.
Which code should you use? Develop the solution by selecting and arranging the required code blocks in the correct order. You may not need all of the code blocks.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
xman
Highly Voted 5 years, 2 months ago
UnicodeEnconding UE = new UnicodeEnconding(); SHA1Managed SHhash = new SHA1Managed(); byte[] MessageBytes = UE.GetBytes(MessageString); byte[] HashValue = SHhash.ComputeHash(MessageBytes); Note: Variables can be declared above everything, or can be declared right before the method usage. UnicodeEnconding UE = new UnicodeEnconding(); byte[] MessageBytes = UE.GetBytes(MessageString); SHA1Managed SHhash = new SHA1Managed(); byte[] HashValue = SHhash.ComputeHash(MessageBytes);
upvoted 14 times
xman
5 years, 2 months ago
Both can be valid
upvoted 3 times
demoinq
4 years, 5 months ago
I think the "Microsoft" approach is to declare variables right before they are being used: have a look here: https://docs.microsoft.com/en-us/dotnet/standard/security/ensuring-data-integrity-with-hash-codes
upvoted 3 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago