Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def set_errorsP1(encoded):
- """
- Допустить ошибку в блоках бинарных данных
- """
- result = ''
- for chunk in chunk_iterator(encoded, CHUNK_LENGTH + len(CHECK_BITS)):
- num_bit = random.randint(1, len(chunk))
- chunk = '{0}{1}{2}'.format(chunk[:num_bit - 1], int(chunk[num_bit - 1]) ^ 1, chunk[num_bit:])
- result += (chunk)
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement