def calculateNonce(realm, algorithm=MD5):
 global SUPPORTED_ALGORITHM, DIGEST_AUTH_ENCODERS
 assert (algorithm in SUPPORTED_ALGORITHM)
 try:
  encoder = DIGEST_AUTH_ENCODERS[algorithm]
 except KeyError:
  raise NotImplementedError(('The chosen algorithm (%s) does not have an implementation yet' % algorithm))
 return encoder(('%d:%s' % (time.time(), realm)))

def calculateNonce ( realm , algorithm = MD5 ) : global SUPPORTED_ALGORITHM , DIGEST_AUTH_ENCODERS assert ( algorithm in SUPPORTED_ALGORITHM ) try : encoder = DIGEST_AUTH_ENCODERS [ algorithm ] except KeyError : raise NotImplementedError ( ( 'The chosen algorithm (%s) does not have an implementation yet' % algorithm ) ) return encoder ( ( '%d:%s' % ( time . time ( ) , realm ) ) )
this is an auxaliary function that calculates nonce value .