Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9dee3042
Commit
9dee3042
authored
Jan 02, 2014
by
Daniel Holth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18585: speed zipfile import by only generating zipfile._ZipDecryptor on demand
parent
daeffd2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
Lib/zipfile.py
Lib/zipfile.py
+3
-1
No files found.
Lib/zipfile.py
View file @
9dee3042
...
@@ -475,13 +475,15 @@ class _ZipDecrypter:
...
@@ -475,13 +475,15 @@ class _ZipDecrypter:
crc
=
((
crc
>>
1
)
&
0x7FFFFFFF
)
crc
=
((
crc
>>
1
)
&
0x7FFFFFFF
)
table
[
i
]
=
crc
table
[
i
]
=
crc
return
table
return
table
crctable
=
_GenerateCRCTable
()
crctable
=
None
def
_crc32
(
self
,
ch
,
crc
):
def
_crc32
(
self
,
ch
,
crc
):
"""Compute the CRC32 primitive on one byte."""
"""Compute the CRC32 primitive on one byte."""
return
((
crc
>>
8
)
&
0xffffff
)
^
self
.
crctable
[(
crc
^
ch
)
&
0xff
]
return
((
crc
>>
8
)
&
0xffffff
)
^
self
.
crctable
[(
crc
^
ch
)
&
0xff
]
def
__init__
(
self
,
pwd
):
def
__init__
(
self
,
pwd
):
if
_ZipDecrypter
.
crctable
is
None
:
_ZipDecrypter
.
crctable
=
_ZipDecrypter
.
_GenerateCRCTable
()
self
.
key0
=
305419896
self
.
key0
=
305419896
self
.
key1
=
591751049
self
.
key1
=
591751049
self
.
key2
=
878082192
self
.
key2
=
878082192
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment