Internal function that computes the descriptor checksum.
(symbols)
| 11 | GENERATOR = [0xf5dee51989, 0xa9fdca3312, 0x1bab10e32d, 0x3706b1677a, 0x644d626ffd] |
| 12 | |
| 13 | def descsum_polymod(symbols): |
| 14 | """Internal function that computes the descriptor checksum.""" |
| 15 | chk = 1 |
| 16 | for value in symbols: |
| 17 | top = chk >> 35 |
| 18 | chk = (chk & 0x7ffffffff) << 5 ^ value |
| 19 | for i in range(5): |
| 20 | chk ^= GENERATOR[i] if ((top >> i) & 1) else 0 |
| 21 | return chk |
| 22 | |
| 23 | def descsum_expand(s): |
| 24 | """Internal function that does the character to symbol expansion""" |
no outgoing calls
no test coverage detected