Skip to content

Instantly share code, notes, and snippets.

@PaburoTC
Last active August 12, 2022 14:38
Show Gist options
  • Save PaburoTC/04cb7ccfeaaeba3fa4af984eac0883f2 to your computer and use it in GitHub Desktop.
Save PaburoTC/04cb7ccfeaaeba3fa4af984eac0883f2 to your computer and use it in GitHub Desktop.
@staticmethod
def __unpad(plain_text):
last_character = plain_text[len(plain_text) - 1:]
bytes_to_remove = ord(last_character)
return plain_text[:-bytes_to_remove]
@maxmine2
Copy link

maxmine2 commented Aug 12, 2022

No offense, but do we need plain_text[len(plain_text) - 1:] here? Can replace it with plain_text[-1]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment