🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: How HTTPS Works: all 10 questions

Quiz: How HTTPS Works · Question 9 of 10

What does this print? (code)

What does this print?

import hashlib
h1 = hashlib.sha256(b"marks: 78").hexdigest()
h2 = hashlib.sha256(b"marks: 87").hexdigest()
print(len(h1), h1 == h2)
  1. A.32 False
  2. B.64 False
  3. C.64 True
  4. D.256 False
Answer & explanation

Correct answer: 64 False

SHA-256 gives 256 bits = 64 hex characters, and different inputs give different hashes.

Can you get the rest right without peeking?

Take the timed Quiz: How HTTPS Works quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →