#NEWLINE# def get_key( self , field ) : #NEWLINE# #INDENT# '\n        Takes something like\n        field="3,79159750" and returns 7 as the index\n        ' #NEWLINE# import hashlib #NEWLINE# field = str ( field ) . encode ( 'utf-8' ) #NEWLINE# number = int ( hashlib . md5 ( field ) . hexdigest ( ) , 16 ) #NEWLINE# position = ( number % number . number_of_keys ) #NEWLINE# return ( self . key + ( ':%s' % position ) )