#NEWLINE# def _create_identifier( ) : #NEWLINE# #INDENT# user_agent = request . headers . get ( 'User-Agent' ) #NEWLINE# if ( user_agent is not None ) : #NEWLINE# #INDENT# user_agent = user_agent . encode ( 'utf-8' ) #NEWLINE# #UNINDENT# base = '{0}|{1}' . format ( _get_remote_addr ( ) , user_agent ) #NEWLINE# if ( str is bytes ) : #NEWLINE# #INDENT# base = text_type ( base , 'utf-8' , errors = 'replace' ) #NEWLINE# #UNINDENT# h = sha512 ( ) #NEWLINE# h . update ( base . encode ( 'utf8' ) ) #NEWLINE# return h . hexdigest ( )