MCPcopy Index your code
hub / github.com/python/cpython / _init_decrypter

Method _init_decrypter

Lib/zipfile/__init__.py:1013–1022  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1011
1012
1013 def _init_decrypter(self):
1014 self._decrypter = _ZipDecrypter(self._pwd)
1015 # The first 12 bytes in the cypher stream is an encryption header
1016 # used to strengthen the algorithm. The first 11 bytes are
1017 # completely random, while the 12th contains the MSB of the CRC,
1018 # or the MSB of the file time depending on the header type
1019 # and is used to check the correctness of the password.
1020 header = self._fileobj.read(12)
1021 self._compress_left -= 12
1022 return self._decrypter(header)[11]
1023
1024 def __repr__(self):
1025 result = ['<%s.%s' % (self.__class__.__module__,

Callers 2

__init__Method · 0.95
seekMethod · 0.95

Calls 2

_ZipDecrypterFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected