Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit a8c20fed authored by ulrich_y's avatar ulrich_y
Browse files

Compress in #17: format for iSsrf

This is taken from

 https://mathematica.stackexchange.com/a/104696
parent 48eee19d
No related branches found
No related tags found
No related merge requests found
# https://mathematica.stackexchange.com/a/104696
import zlib
import base64
import struct
import StringIO
......@@ -11,3 +12,26 @@ def decomp(b):
if fp.read(4) != "!boR":
raise KeyError("Header is not matching")
return fp
def parse(fp):
ans = []
cur = []
while True:
cmd = fp.read(1)
if cmd == '':
ans.append(cur)
return ans
elif cmd == 'i':
cur.append(struct.unpack('<i', fp.read(4))[0])
elif cmd == 'S' or cmd == 's':
le = struct.unpack('<i', fp.read(4))[0]
cur.append(fp.read(le))
elif cmd == 'r':
cur.append(struct.unpack('<d', fp.read(8))[0])
elif cmd == 'f':
le = struct.unpack('<i', fp.read(4))[0]
ans.append(cur[:])
cur = []
else:
raise KeyError("Unknown cmd %s" % cmd)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment