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

Function encode_file

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

Encrypt a file from source to destination.

(source, destination, major, minor)

Source from the content-addressed store, hash-verified

79################################################################################
80
81def encode_file(source, destination, major, minor):
82 'Encrypt a file from source to destination.'
83 _check_major(major)
84 _check_minor(minor)
85 map_1 = _encode_map_1(major)
86 map_2 = _encode_map_2(minor)
87 string = source.read(2 ** 20 / 5)
88 while string:
89 destination.write(_encode(string, map_1, map_2))
90 string = source.read(2 ** 20 / 5)
91
92def decode_file(source, destination, major, minor):
93 'Decrypt a file from source to destination.'

Callers

nothing calls this directly

Calls 7

_encode_map_1Function · 0.85
_encode_map_2Function · 0.85
_check_majorFunction · 0.70
_check_minorFunction · 0.70
_encodeFunction · 0.70
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected