1
0

removed trailing whitespace and fixed indentation in history widget

This commit is contained in:
Tafelpoot
2014-10-21 19:05:51 +02:00
parent 49c0a3a08f
commit d9c5250a6f
35 changed files with 230 additions and 267 deletions

View File

@@ -51,27 +51,27 @@ class RIPEMD160:
"""Return a new RIPEMD160 object. An optional string argument
may be provided; if present, this string will be automatically
hashed."""
def __init__(self, arg=None):
self.ctx = RMDContext()
if arg:
self.update(arg)
self.dig = None
def update(self, arg):
"""update(arg)"""
"""update(arg)"""
RMD160Update(self.ctx, arg, len(arg))
self.dig = None
def digest(self):
"""digest()"""
"""digest()"""
if self.dig:
return self.dig
ctx = self.ctx.copy()
self.dig = RMD160Final(self.ctx)
self.ctx = ctx
return self.dig
def hexdigest(self):
"""hexdigest()"""
dig = self.digest()
@@ -79,9 +79,9 @@ class RIPEMD160:
for d in dig:
hex_digest += '%02x' % ord(d)
return hex_digest
def copy(self):
"""copy()"""
"""copy()"""
import copy
return copy.deepcopy(self)
@@ -90,7 +90,7 @@ class RIPEMD160:
def new(arg=None):
"""Return a new RIPEMD160 object. An optional string argument
may be provided; if present, this string will be automatically
hashed."""
hashed."""
return RIPEMD160(arg)
@@ -260,7 +260,7 @@ def RMD160Transform(state, block): #uint32 state[5], uchar block[64]
b = state[1]
c = state[2]
d = state[3]
e = state[4]
e = state[4]
#/* Parallel round 1 */
a, c = R(a, b, c, d, e, F4, KK0, 8, 5, x)
@@ -361,7 +361,7 @@ def RMD160Transform(state, block): #uint32 state[5], uchar block[64]
def RMD160Update(ctx, inp, inplen):
if type(inp) == str:
inp = [ord(i)&0xff for i in inp]
have = (ctx.count / 8) % 64
need = 64 - have
ctx.count += 8 * inplen