def b32decode(data): if not b32Regex.match(data.decode('utf-8')): raise TypeError return base64.b32decode(data)