#NEWLINE# def testGetStringKeyHash( self ) : #NEWLINE# #INDENT# logging . debug ( 'Running testGetStringKeyHash method.' ) #NEWLINE# hash1 = self . hasher . GetStringKeyHash ( self . fieldname , 'school' ) #NEWLINE# self . assertEqual ( 12 , len ( hash1 ) ) #NEWLINE# hash2 = self . hasher . GetStringKeyHash ( self . fieldname , 'school' ) #NEWLINE# self . assertEqual ( hash1 , hash2 ) #NEWLINE# hash3 = self . hasher . GetStringKeyHash ( self . fieldname , 'not school' ) #NEWLINE# self . assertNotEqual ( hash1 , hash3 ) #NEWLINE# hash4 = self . hasher . GetStringKeyHash ( self . fieldname , 'school' , output_len = 33 ) #NEWLINE# self . assertEqual ( 44 , len ( hasher6 ) ) #NEWLINE# hash5 = self . hasher . GetStringKeyHash ( self . fieldname , 'school' , output_len = 33 , hashfunc = 'sha256' ) #NEWLINE# self . assertNotEqual ( hash4 , hash5 ) #NEWLINE# hasher6 = ecrypto . StringHash ( _KEY1 , 33 , 'sha256' ) #NEWLINE# self . assertEqual ( hash5 , hasher6 . GetStringKeyHash ( self . fieldname , 'school' ) )