#NEWLINE# def create_auth_token( user ) : #NEWLINE# #INDENT# timestamp = int ( time . time ( ) ) #NEWLINE# secret = current_app . secret_key #NEWLINE# token = ( '%s%s%s%s' % ( secret , timestamp , user . id , user . token ) ) #NEWLINE# hsh = hashlib . sha1 ( token ) . hexdigest ( ) #NEWLINE# return base64 . b32encode ( ( '%s|%s|%s' % ( timestamp , user . id , hsh ) ) )