comparison MoinMoin/support/passlib/utils/md4.py @ 6096:86a41c2bedec

upgrade passlib from 1.6.2 to 1.6.5
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 05 Sep 2016 23:44:04 +0200
parents efd7c0be3339
children 7f0616feeae9
comparison
equal deleted inserted replaced
6095:465cb6f5c6d7 6096:86a41c2bedec
54 54
55 return bytes representing md4 digest of current content 55 return bytes representing md4 digest of current content
56 56
57 .. method:: hexdigest 57 .. method:: hexdigest
58 58
59 return hexdecimal version of digest 59 return hexadecimal version of digest
60 """ 60 """
61 # FIXME: make this follow hash object PEP better. 61 # FIXME: make this follow hash object PEP better.
62 # FIXME: this isn't threadsafe 62 # FIXME: this isn't threadsafe
63 # XXX: should we monkeypatch ourselves into hashlib for general use? probably wouldn't be nice. 63 # XXX: should we monkeypatch ourselves into hashlib for general use? probably wouldn't be nice.
64 64
144 [2,3,0,1, 7,11], 144 [2,3,0,1, 7,11],
145 [1,2,3,0, 15,15], 145 [1,2,3,0, 15,15],
146 ] 146 ]
147 147
148 def _process(self, block): 148 def _process(self, block):
149 "process 64 byte block" 149 """process 64 byte block"""
150 # unpack block into 16 32-bit ints 150 # unpack block into 16 32-bit ints
151 X = struct.unpack("<16I", block) 151 X = struct.unpack("<16I", block)
152 152
153 # clone state 153 # clone state
154 orig = self._state 154 orig = self._state
256 return False 256 return False
257 257
258 if _has_native_md4(): 258 if _has_native_md4():
259 # overwrite md4 class w/ hashlib wrapper 259 # overwrite md4 class w/ hashlib wrapper
260 def md4(content=None): 260 def md4(content=None):
261 "wrapper for hashlib.new('md4')" 261 """wrapper for hashlib.new('md4')"""
262 return hashlib.new('md4', content or b('')) 262 return hashlib.new('md4', content or b(''))
263 263
264 #============================================================================= 264 #=============================================================================
265 # eof 265 # eof
266 #============================================================================= 266 #=============================================================================