mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Port a few remaining chr() calls
This commit is contained in:
parent
c83cdcf086
commit
e049c10729
File diff suppressed because one or more lines are too long
@ -239,7 +239,7 @@ class PackedIon(PackedData):
|
|||||||
|
|
||||||
def unpack_unsigned_int(self, length):
|
def unpack_unsigned_int(self, length):
|
||||||
# unsigned big-endian (MSB first)
|
# unsigned big-endian (MSB first)
|
||||||
return struct.unpack_from(b'>Q', chr(0) * (8 - length) + self.extract(length))[0]
|
return struct.unpack_from(b'>Q', b'\0' * (8 - length) + self.extract(length))[0]
|
||||||
|
|
||||||
|
|
||||||
def property_name(property_number):
|
def property_name(property_number):
|
||||||
|
@ -487,7 +487,7 @@ class _ZipDecrypter:
|
|||||||
self.key0 = self._crc32(c, self.key0)
|
self.key0 = self._crc32(c, self.key0)
|
||||||
self.key1 = (self.key1 + (self.key0 & 255)) & 4294967295
|
self.key1 = (self.key1 + (self.key0 & 255)) & 4294967295
|
||||||
self.key1 = (self.key1 * 134775813 + 1) & 4294967295
|
self.key1 = (self.key1 * 134775813 + 1) & 4294967295
|
||||||
self.key2 = self._crc32(chr((self.key1 >> 24) & 255), self.key2)
|
self.key2 = self._crc32(((self.key1 >> 24) & 255), self.key2)
|
||||||
|
|
||||||
def __call__(self, c):
|
def __call__(self, c):
|
||||||
"""Decrypt a single byte."""
|
"""Decrypt a single byte."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user