from allmydata.interfaces import ICodecEncoder, ICodecDecoder
import fec
-def netstring(s):
- return "%d:%s," % (len(s), s)
-
-from base64 import b32encode
-def ab(x): # debuggery
- if len(x) >= 3:
- return "%s:%s" % (len(x), b32encode(x[-3:]),)
- elif len(x) == 2:
- return "%s:%s" % (len(x), b32encode(x[-2:]),)
- elif len(x) == 1:
- return "%s:%s" % (len(x), b32encode(x[-1:]),)
- elif len(x) == 0:
- return "%s:%s" % (len(x), "--empty--",)
-
class ReplicatingEncoder(object):
implements(ICodecEncoder)