Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
53 lines (41 loc) · 1.51 KB

File metadata and controls

53 lines (41 loc) · 1.51 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from .pyradiogatun import RadioGatunType
__all__ = ['new']
def new(data=None,wl=64):
"""Create a new pure python RadioGatun hash object
wl = wordlength (in bits) of the RadioGatun hash method
between 1 and 64 (default = 64)
data = if present, the method call update(arg) is made
EXAMPLES: (testvectors from: http://radiogatun.noekeon.org/)
==========
>>> from CryptoPlus.Hash import python_RadioGatun
radiogatun[64]
---------------
>>> hasher = python_RadioGatun.new()
>>> hasher.update(b'1234567890123456')
>>> hasher.hexdigest()
'caaec14b5b4a7960d6854709770e3071d635d60224f58aa385867e549ef4cc42'
>>> hasher = python_RadioGatun.new()
>>> hasher.update(b'Santa Barbara, California')
>>> hasher.hexdigest()
'0d08daf2354fa95aaa5b6a50f514384ecdd35940252e0631002e600e13cd285f'
radiogatun[32]
---------------
>>> hasher = python_RadioGatun.new(wl=32)
>>> hasher.update(b'1234567890123456')
>>> hasher.hexdigest()
'59612324f3f42d3096e69125d2733b86143ae668ae9ed561ad785e0eac8dba25'
>>> hasher = python_RadioGatun.new(wl=32)
>>> hasher.update(b'Santa Barbara, California')
>>> hasher.hexdigest()
'041666388ef9655d48996a66dada1193d6646012a7b25a24fb10e6075cf0fc54'
"""
crypto = RadioGatunType(wl)
if data:
crypto.update(data)
return crypto
def _test():
import doctest
doctest.testmod()
if __name__ == "__main__":
print("DOCTEST running... no messages = all good")
_test()
Morty Proxy This is a proxified and sanitized view of the page, visit original site.