MCPcopy Create free account
hub / github.com/ActiveState/code / read

Method read

recipes/Python/572196_RSA/recipe-572196.py:205–216  ·  view source on GitHub ↗
(self,bytes=None)

Source from the content-addressed store, hash-verified

203 self.f.write(encrypt(self.wbuf,self.e,self.n,self.bits))
204 self.wbuf=""
205 def read(self,bytes=None):
206 if bytes==None:
207 self.rbuf+=decrypt(self.f.read(),self.d,self.n,self.bits)
208 ret=self.rbuf
209 self.rbuf=""
210 else:
211 _bytes=bytes-len(self.rbuf)
212 rbytes=_bytes+(self.bits-_bytes%self.bits)
213 self.rbuf+=decrypt(self.f.read(rbytes),self.d,self.n,self.bits)
214 ret=self.rbuf[:bytes]
215 self.rbuf=self.rbuf[bytes:]
216 return ret
217 def readline(self):
218 ret=""
219 while not ret.endswith('\n'):

Callers 15

readlineMethod · 0.95
readlineMethod · 0.45
searchMethod · 0.45
__uaMethod · 0.45
recipe-52297.pyFile · 0.45
do_POSTMethod · 0.45
recipe-546517.pyFile · 0.45
get_commandFunction · 0.45
__init__Method · 0.45
write_partMethod · 0.45
download_othersFunction · 0.45
download_ucomics_dot_comFunction · 0.45

Calls 1

decryptFunction · 0.70

Tested by 11

test_exit_cleanlyMethod · 0.36
test_exceptionMethod · 0.36
test_signalMethod · 0.36
test_appended_signalMethod · 0.36
test_kinterruptMethod · 0.36
test_systemexitMethod · 0.36
test_called_onceMethod · 0.36
test_cascadeMethod · 0.36
test_all_exit_sigsMethod · 0.36
test_as_decoMethod · 0.36