#NEWLINE# def create_nonce( user , action , offset = 0 ) : #NEWLINE# #INDENT# if ( not user ) : #NEWLINE# #INDENT# nick = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# nick = user . nick #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# if settings . MANAGE_PY : #NEWLINE# #INDENT# nick = clean . nick ( user ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# i = math . ceil ( ( time . time ( ) / 43200 ) ) #NEWLINE# i += offset #NEWLINE# nonce = hash_generic ( ( ( str ( i ) + action ) + nick ) ) #NEWLINE# return nonce [ ( - 12 ) : ( - 2 ) ]