def synthesize_nonce(s, key, timestamp=None):
 if (timestamp is None):
  timestamp = int(time.time())
 h = md5_hex(('%s:%s:%s' % (timestamp, s, key)))
 nonce = ('%s:%s' % (timestamp, h))
 return nonce

def synthesize_nonce ( s , key , timestamp = None ) : if ( timestamp is None ) : timestamp = int ( time . time ( ) ) h = md5_hex ( ( '%s:%s:%s' % ( timestamp , s , key ) ) ) nonce = ( '%s:%s' % ( timestamp , h ) ) return nonce
synthesize a nonce value which resists spoofing and can be checked for staleness .