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.