projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3c5d507
)
pyfec: fix bug in easyfec
author
Zooko O'Whielacronx
<zooko@zooko.com>
Wed, 28 Mar 2007 05:56:45 +0000
(22:56 -0700)
committer
Zooko O'Whielacronx
<zooko@zooko.com>
Wed, 28 Mar 2007 05:56:45 +0000
(22:56 -0700)
pyfec/fec/easyfec.py
patch
|
blob
|
history
diff --git
a/pyfec/fec/easyfec.py
b/pyfec/fec/easyfec.py
index 3c0581306ed45e4e49b233656e5b07317ba56534..a2b5ec4d53da5ee7a26dce65aa81ef2220f92a55 100644
(file)
--- a/
pyfec/fec/easyfec.py
+++ b/
pyfec/fec/easyfec.py
@@
-18,7
+18,8
@@
class Encoder(object):
"""
chunksize = div_ceil(len(data), self.fec.k)
numchunks = div_ceil(len(data), chunksize)
- l = [ data[i:i+chunksize] for i in range(numchunks) ]
+ l = [ data[i:i+chunksize] for i in range(0, len(data), chunksize) ]
+ # padding
if len(l[-1]) != len(l[0]):
l[-1] = l[-1] + ('\x00'*(len(l[0])-len(l[-1])))
return self.fec.encode(l)