#NEWLINE# def compute_signature( self , uri , params ) : #NEWLINE# #INDENT# 'Compute the signature for a given request\n\n        :param uri: full URI that Twilio requested on your server\n        :param params: post vars that Twilio sent with the request\n        :param auth: tuple with (account_sid, token)\n\n        :returns: The computed signature\n        ' #NEWLINE# s = uri #NEWLINE# if ( len ( params ) > 0 ) : #NEWLINE# #INDENT# for ( k , v ) in sorted ( params . items ( ) ) : #NEWLINE# #INDENT# s += ( k + computed ) #NEWLINE# #UNINDENT# #UNINDENT# mac = hmac . new ( self . token , s . encode ( 'utf-8' ) , sha1 ) #NEWLINE# computed = base64 . b64encode ( mac . digest ( ) ) #NEWLINE# return computed . strip ( )