kopia lustrzana https://github.com/micropython/micropython-lib
upip: upip_gzip.py no longer used, remove.
rodzic
6764d27d78
commit
62671a4795
|
@ -1,28 +0,0 @@
|
|||
#import zlib
|
||||
import uzlib as zlib
|
||||
|
||||
FTEXT = 1
|
||||
FHCRC = 2
|
||||
FEXTRA = 4
|
||||
FNAME = 8
|
||||
FCOMMENT = 16
|
||||
|
||||
def decompress(data):
|
||||
assert data[0] == 0x1f and data[1] == 0x8b
|
||||
assert data[2] == 8
|
||||
flg = data[3]
|
||||
assert flg & 0xe0 == 0
|
||||
i = 10
|
||||
if flg & FEXTRA:
|
||||
i += data[11] << 8 + data[10] + 2
|
||||
if flg & FNAME:
|
||||
while data[i]:
|
||||
i += 1
|
||||
i += 1
|
||||
if flg & FCOMMENT:
|
||||
while data[i]:
|
||||
i += 1
|
||||
i += 1
|
||||
if flg & FHCRC:
|
||||
i += 2
|
||||
return zlib.decompress(memoryview(data)[i:], -15)
|
Ładowanie…
Reference in New Issue