def generate_totp(secret, period=30, timestamp=None):
 if (timestamp is None):
  timestamp = time.time()
 counter = (int(timestamp) // period)
 return generate_hotp(secret, counter)

def generate_totp ( secret , period = 30 , timestamp = None ) : if ( timestamp is None ) : timestamp = time . time ( ) counter = ( int ( timestamp ) // period ) return generate_hotp ( secret , counter )
generate a totp code .