Skip to content

Commit

Permalink
cleanup of previous patch
Browse files Browse the repository at this point in the history
  • Loading branch information
LRGH committed Mar 17, 2017
1 parent 391fd6e commit 044dbc5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions crysp/bits.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ def __init__(self,v,size=None,bitorder=-1):
self.ival = (self.ival<<1)|(x&1)
elif isinstance(v,bytes):
self.load(v,bitorder)
elif isinstance(v,str):
# We are using python3, because 'str' and 'bytes' are different
self.load(v.encode(),bitorder)
else:
raise TypeError(v)
if size!=None: self.size = size
Expand Down
3 changes: 1 addition & 2 deletions crysp/crc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def crc(data,table,Xinit=0,Xfinal=None):
print("crc: bytes input required")
return None
r = Bits(Xinit,table[0].size)
data = struct.unpack("%dB"%len(data), data)
for b in data:
for b in struct.unpack("%dB"%len(data), data):
p = table[(r.ival^b)&0xff]
r = (r>>8)^p
if Xfinal:
Expand Down

0 comments on commit 044dbc5

Please sign in to comment.