Hash: added doctests + little fixes
[python-cryptoplus.git] / src / CryptoPlus / Hash / python_SHA384.py
blob847829675b0bc43f25b8eaa983a9dcd5cf27cf84
1 from pysha384 import sha384
3 __all__ = ['new','digest_size']
5 def new(data=""):
6 """Create a new pure python SHA-384 hash object
8 data = initial input (raw string) to the hashing object
9 if present, the method call update(arg) is made
11 EXAMPLE: FIPS 180-2
12 =========
14 >>> from CryptoPlus.Hash import python_SHA384
16 >>> message = "abc"
17 >>> hasher = python_SHA384.new()
18 >>> hasher.update(message)
19 >>> hasher.hexdigest()
20 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7'
22 >>> message = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
23 >>> hasher = python_SHA384.new()
24 >>> hasher.update(message)
25 >>> hasher.hexdigest()
26 '09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039'
27 """
28 return sha384(data)
30 digest_size = sha384.digest_size