ed26b930efbad18ef7f9a390d5bb2f15abc73fbb
[python-cryptoplus.git] / src / CryptoPlus / Hash / python_MD5.py
blobed26b930efbad18ef7f9a390d5bb2f15abc73fbb
1 import pymd5
3 __all__ = ['new','digest_size']
5 def new(data=""):
6 """Create a new pure python MD5 hash object
8 data = initial input (raw string) to the hashing object
9 if present, the method call update(arg) is made
11 EXAMPLE: (http://www.rfc-editor.org/rfc/rfc1321.txt)
12 =========
14 >>> from CryptoPlus.Hash import MD5
16 >>> message = "abc"
17 >>> hasher = MD5.new()
18 >>> hasher.update(message)
19 >>> hasher.hexdigest()
20 '900150983cd24fb0d6963f7d28e17f72'
22 >>> message = "message digest"
23 >>> hasher = MD5.new()
24 >>> hasher.update(message)
25 >>> hasher.hexdigest()
26 'f96b697d7cb7938d525a2f31aaf161d0'
27 """
28 return pymd5.new(data)
30 digest_size = pymd5.digest_size