diff --git a/sources/29-web2py-english/09.markmin b/sources/29-web2py-english/09.markmin index 5598afdf..a56531b6 100644 --- a/sources/29-web2py-english/09.markmin +++ b/sources/29-web2py-english/09.markmin @@ -922,6 +922,8 @@ def verify_otp(user, otp): for t in range(time_start - 1, time_end + 1): to_hash = str(t) + user.motp_secret + user.motp_pin hash = md5(to_hash).hexdigest()[:6] + # Comment the previous line and uncomment the next line if using Python 3. + # hash = md5(to_hash.encode(encoding='utf8')).hexdigest()[:6] if otp == hash: return hash