(bytes_obj, byte_map, grid, index, block_size)
| 421 | # block_size |
| 422 | # - length of each edge in a grid |
| 423 | def _decode(bytes_obj, byte_map, grid, index, block_size): |
| 424 | cache = bytes() |
| 425 | index = [0] + index |
| 426 | for byte in bytes_obj: |
| 427 | if byte in byte_map: |
| 428 | index.append(byte_map[byte]) |
| 429 | index = index[1:] |
| 430 | decoded = eval_index(grid, block_size, index) |
| 431 | index[-1] = byte_map[decoded] |
| 432 | cache += bytes([decoded]) |
| 433 | else: |
| 434 | cache += bytes([byte]) |
| 435 | return cache, index[1:] |
| 436 | |
| 437 | # bytes_obj |
| 438 | # - the bytes to decode |
no test coverage detected