Turn the list of bits -> data, into a string
(self, data)
| 435 | return result |
| 436 | |
| 437 | def __BitList_to_String(self, data): |
| 438 | """Turn the list of bits -> data, into a string""" |
| 439 | result = [] |
| 440 | pos = 0 |
| 441 | c = 0 |
| 442 | while pos < len(data): |
| 443 | c += data[pos] << (7 - (pos % 8)) |
| 444 | if (pos % 8) == 7: |
| 445 | result.append(c) |
| 446 | c = 0 |
| 447 | pos += 1 |
| 448 | |
| 449 | if _pythonMajorVersion < 3: |
| 450 | return ''.join([ chr(c) for c in result ]) |
| 451 | else: |
| 452 | return bytes(result) |
| 453 | |
| 454 | def __permutate(self, table, block): |
| 455 | """Permutate this block with the specified table""" |