Python Programming - Standard Libraries - Discussion
Discussion Forum : Standard Libraries - General Questions (Q.No. 83)
83.
How can you use the
hashlib
module in Python to calculate the SHA-256 hash of a string?
Answer: Option
Explanation:
import hashlib
# Example usage of hashlib module for calculating the SHA-256 hash of a string
string = 'Hello, World!'
hashed_string = hashlib.sha256(string.encode()).hexdigest()
print(hashed_string)
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers