Last active
August 12, 2022 14:38
-
-
Save PaburoTC/04cb7ccfeaaeba3fa4af984eac0883f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No offense, but do we need
plain_text[len(plain_text) - 1:]
here? Can replace it withplain_text[-1]
?