def removeBitPadding(str, blocksize=AES_blocksize):
    'Remove bit padding with 0x80 followed by zero (null) bytes'
    pad_len = 0    
    for char in str[::-1]: # str[::-1] reverses string
        if char == '\0':
            pad_len += 1
        else:
            break
    pad_len += 1
    str = str[:-pad_len]
   
    return str
def removeBitPadding ( str , blocksize = AES_blocksize ) : pad_len = 0 for char in str [ : : - 1 ] : if char == '\0' : pad_len += 1 else : break pad_len += 1 str = str [ : - pad_len ] return str
Remove bit padding with 0x80 followed by zero (null) bytes