(bytes_obj, byte_map, grid, index, block_size)
| 351 | # block_size |
| 352 | # - length of each edge in a grid |
| 353 | def _encode(bytes_obj, byte_map, grid, index, block_size): |
| 354 | cache = bytes() |
| 355 | index = [0] + index |
| 356 | for byte in bytes_obj: |
| 357 | if byte in byte_map: |
| 358 | index.append(byte_map[byte]) |
| 359 | index = index[1:] |
| 360 | cache += bytes([eval_index(grid, block_size, index)]) |
| 361 | else: |
| 362 | cache += bytes([byte]) |
| 363 | return cache, index[1:] |
| 364 | |
| 365 | # bytes_obj |
| 366 | # - the bytes to encode |
no test coverage detected