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

Method read

recipes/Python/572159_SPICE/recipe-572159.py:127–135  ·  view source on GitHub ↗

Read and decrypt from file.

(self, size=-1)

Source from the content-addressed store, hash-verified

125 self.tail = ''
126
127 def read(self, size=-1):
128 'Read and decrypt from file.'
129 string = self.__file.read(size * 4)
130 tail_len = len(string) % 4
131 if tail_len:
132 self.tail = string[-tail_len:]
133 return _decode(string[:-tail_len], self.__dm1, self.__dm2)
134 else:
135 return _decode(string, self.__dm1, self.__dm2)
136
137 def write(self, string):
138 'Encrypt and write to file.'

Callers 3

encode_fileFunction · 0.45
decode_fileFunction · 0.45
recipe-572159.pyFile · 0.45

Calls 1

_decodeFunction · 0.70

Tested by

no test coverage detected