(l)
| 75 | |
| 76 | |
| 77 | def ser_compact_size(l): |
| 78 | r = b"" |
| 79 | if l < 253: |
| 80 | r = struct.pack("B", l) |
| 81 | elif l < 0x10000: |
| 82 | r = struct.pack("<BH", 253, l) |
| 83 | elif l < 0x100000000: |
| 84 | r = struct.pack("<BI", 254, l) |
| 85 | else: |
| 86 | r = struct.pack("<BQ", 255, l) |
| 87 | return r |
| 88 | |
| 89 | def deser_compact_size(f): |
| 90 | nit = struct.unpack("<B", f.read(1))[0] |
no outgoing calls
no test coverage detected