class - hashlib

 

 


hashlib

 

>>> import hashlib

# 支援 MD5, SHA256, SHA384, and SHA512

>>> m = hashlib.md5()

# Update the hash object with the object arg

>>> m.update(b"Nobody inspects")

# Return a bytes object of size digest_size

>>> m.digest()

# The size of the resulting hash in bytes.

>>> m.digest_size

# Like digest() except the digest is returned as a string object

>>> m.hexdigest()

 

 


 

 

 

 

 

 

Creative Commons license icon Creative Commons license icon