code: def pkcs7_unpad(data):
      
      if isinstance(data, str):
          return data[0:-ord(data[-1])]
      else:
          return data[0:-data[-1]]
docs: Remove the padding bytes that were added at point of encryption.
  
      Implementation copied from pyaspora:
      https://github.com/mjnovice/pyaspora/blob/master/pyaspora/diaspora/protocol.py#L209