def generate_nonce ( ) : nonce = '' . join ( [ str ( randint ( 0 , 9 ) ) for i in range ( 8 ) ] ) return HMAC ( nonce . encode ( ) , "secret" . encode ( ) , sha1 ) . hexdigest ( )
how to generate nonce in python
Generate nonce number
def generate_nonce():
        """ Generate nonce number """
        nonce = ''.join([str(randint(0, 9)) for i in range(8)])
        return HMAC(
            nonce.encode(),
            "secret".encode(),
            sha1
        ).hexdigest()