def generate_totp_secret(length=10):
 assert (type(length) in six.integer_types)
 return base64.b32encode(os.urandom(length)).decode('ascii')

def generate_totp_secret ( length = 10 ) : assert ( type ( length ) in six . integer_types ) return base64 . b32encode ( os . urandom ( length ) ) . decode ( 'ascii' )
generates a new base32 encoded .