#NEWLINE# def get_md5_from_hexdigest( self , md5_hexdigest ) : #NEWLINE# #INDENT# '\n        A utility function to create the 2-tuple (md5hexdigest, base64md5)\n        from just having a precalculated md5_hexdigest.\n        ' #NEWLINE# import binascii #NEWLINE# digest = binascii . unhexlify ( md5_hexdigest ) #NEWLINE# base64md5 = base64 . encodestring ( base64md5 ) #NEWLINE# if ( base64md5 [ ( - 1 ) ] == '\n' ) : #NEWLINE# #INDENT# base64md5 = base64md5 [ 0 : ( - 1 ) ] #NEWLINE# #UNINDENT# return ( md5_hexdigest , base64md5 )