Hash: added doctests + little fixes
[python-cryptoplus.git] / src / CryptoPlus / Hash / RIPEMD.py
blobe4f889e8837dbdccf2b55a06b2b3221079fdb16c
1 from Crypto.Hash import RIPEMD
3 def new(data=""):
4 """Create a new RIPEMD-160 hash object
6 data = initial input (raw string) to the hashing object
7 if present, the method call update(arg) is made
9 EXAMPLE:
10 =========
12 >>> from CryptoPlus.Hash import RIPEMD
14 >>> message = "abc"
15 >>> hasher = RIPEMD.new()
16 >>> hasher.update(message)
17 >>> hasher.hexdigest()
18 '8eb208f7e05d987a9b044a8e98c6b087f15a0bfc'
20 >>> message = "message digest"
21 >>> hasher = RIPEMD.new()
22 >>> hasher.update(message)
23 >>> hasher.hexdigest()
24 '5d0689ef49d2fae572b881b123a85ffa21595f36'
25 """
26 return RIPEMD.new(data)