def __init__(self, s: str='ABCDEFGHIJKLMNOP'):
"""
Initializes the class with a secret key, using an application-wide
default if none is provided.
:param s: Expected to be a base32-encoded string, 16 characters long.
:type s: str
:return:
:rtype:
"""
if '-' in s:
s = s.replace('-', '')
self._raw_secret = s.upper().rjust(16, 'A')[0:16]
self._secret = base64.b32decode(self._raw_secret.encode())
评论列表
文章目录