1 from pyradiogatun
import RadioGatunType
5 def new(wl
=64,arg
=None):
6 """Return a new RadioGatun hash object
8 wl = wordlength (in bits) of the RadioGatun hash method
9 between 1 and 64 (default = 64)
10 arg = if present, the method call update(arg) is made
12 EXAMPLES: (testvectors from: http://radiogatun.noekeon.org/)
14 >>> import python_RadioGatun
18 >>> hasher = python_RadioGatun.new()
19 >>> hasher.update('1234567890123456')
20 >>> hasher.hexdigest()
21 'caaec14b5b4a7960d6854709770e3071d635d60224f58aa385867e549ef4cc42'
23 >>> hasher = python_RadioGatun.new()
24 >>> hasher.update('Santa Barbara, California')
25 >>> hasher.hexdigest()
26 '0d08daf2354fa95aaa5b6a50f514384ecdd35940252e0631002e600e13cd285f'
30 >>> hasher = python_RadioGatun.new(32)
31 >>> hasher.update('1234567890123456')
32 >>> hasher.hexdigest()
33 '59612324f3f42d3096e69125d2733b86143ae668ae9ed561ad785e0eac8dba25'
35 >>> hasher = python_RadioGatun.new(32)
36 >>> hasher.update('Santa Barbara, California')
37 >>> hasher.hexdigest()
38 '041666388ef9655d48996a66dada1193d6646012a7b25a24fb10e6075cf0fc54'
41 crypto
= RadioGatunType(wl
)
51 if __name__
== "__main__":
52 print "DOCTEST running... no messages = all good"