[Tutor] Verifying password hash is base64

Ken Lai iken124 at gmail.com
Tue Nov 16 13:13:11 EST 2021


Hi All,

I have a program that hashes passwords into base64, but I need to confirm.
I found C# code on the net:

public static bool IsBase64String(this string s)
{
    s = s.Trim();
    return (s.Length % 4 == 0) && Regex.IsMatch(s,
@"^[a-zA-Z0-9\+/]*={0,3}$", RegexOptions.None);

}

Does Python have an equivalent?


TIA,


More information about the Tutor mailing list