On Tue, May 19, 2020 at 3:50 PM Alex Hall <alex.mojaki@gmail.com> wrote:
Anyway, you could write:
assert not salt.endswith("=" * 3)  # at most 2 ='s allowed
salt = salt.rstrip("=")

Yes, I *could* write that.  It feels a bit more  cryptic than the version I mentioned.  But it's fine.

--
The dead increasingly dominate and strangle both the living and the
not-yet born.  Vampiric capital and undead corporate persons abuse
the lives and control the thoughts of homo faber. Ideas, once born,
become abortifacients against new conceptions.