{"id":169733,"date":"2013-02-18T10:27:04","date_gmt":"2013-02-18T06:27:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=169733"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=169733","title":{"rendered":"<span class=\"post_title\">\u0417\u0430\u043c\u0435\u0442\u043a\u0438 \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 hashCode() \u0432 Java<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0427\u0430\u0441\u0442\u043e \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e hashCode().<br \/>  \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0437\u0434\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0435\u0435 \u0441\u0432\u044f\u0437\u044c \u0441 \u0434\u0440\u0443\u0433\u043e\u0439, \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 equals(). \u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430\u0445 \u043f\u043e Java \u0438 \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u0435\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c. \u041c\u043d\u0435 \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043b\u0438\u0448\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435: hashCode \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u042f \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f: \u201c\u0410 \u0447\u0435\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435?\u201d<\/p>\n<p>  \u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c. \u041c\u043d\u0435 \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438, \u0435\u0441\u043b\u0438 \u044f \u0433\u0434\u0435-\u0442\u043e \u043e\u0448\u0438\u0431\u0441\u044f \u0432 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f\u0445.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0421\u043f\u0440\u043e\u0441\u0438\u043c \u0443 \u0413\u0443\u0440\u0443<\/h2>\n<p>  \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a Java \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 Object.hashCode(). \u041a\u0430\u043a \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0442\u0430\u043c \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u043e\u0448\u0435\u043b \u043a \u0413\u0443\u0440\u0443. \u0411\u0440\u044e\u0441 \u042d\u043a\u043a\u0435\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043b 5 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043a\u0438\u0432\u043d\u0443\u043b \u043d\u0430 \u0411\u043b\u043e\u0445\u0430 (\u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043f\u0438\u0441\u0430\u043b \u0443 \u043d\u0435\u0433\u043e), \u043f\u0440\u0438\u0432\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u201c\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u201d. \u0414\u0436\u043e\u0448\u0443\u0430 \u0411\u043b\u043e\u0445 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u043b\u0443\u0447\u0448\u0435: \u043e\u043d \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0432\u044b\u0441\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0438\u2026 \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440. \u042f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0435 \u0443\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0446\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<blockquote><p>The multiplier 37 was chosen because it is an odd prime. \u2026 The advantages of using a prime number are less clear, but it is traditional to use primes for this purpose.  <\/p><\/blockquote>\n<p>  \u041d\u0438\u043a\u0442\u043e \u0438\u0437 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u043d\u0435 \u0443\u0434\u043e\u0441\u0443\u0436\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0438 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h2>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c (\u0432 \u0432\u043e\u043b\u044c\u043d\u043e\u043c \u043f\u0435\u0440\u0435\u0441\u043a\u0430\u0437\u0435)<\/h2>\n<p>  1) \u0412\u0437\u044f\u0442\u044c \u0447\u0438\u0441\u043b\u043e, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442 \u043d\u0443\u043b\u044f, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 17. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e p. \u041f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 result \u044d\u0442\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (result = p).<br \/>  2) \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c hashCode c \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c. \u042d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043d\u0430\u0441 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442, \u043e\u043d\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 (int) \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c hashCode \u0440\u0430\u0432\u043d\u044b\u043c \u0441\u0430\u043c\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0447\u0438\u0441\u043b\u0430\u2026<br \/>  3) \u0421\u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c result \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 hashCode \u0441: result = result * q + c, \u0433\u0434\u0435 q = 37, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043c\u043d\u0438\u043c, \u043e\u043d\u043e \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0435.<br \/>  4) \u0412\u0435\u0440\u043d\u0443\u0442\u044c result.<\/p>\n<h2>\u0410\u043d\u0430\u043b\u0438\u0437 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430<\/h2>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0439:<br \/>  1) \u041a\u0430\u043a \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0431\u0443\u0434\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.<br \/>  2) \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e hashCode \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 2<sup>32<\/sup>. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438.<br \/>  3) \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<br \/>  4) \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f hashCode \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b, \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c, \u044f \u0441\u0442\u0430\u043d\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0438 \u0441 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 (x, y) \u043d\u0430 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438 \u0432 \u0434\u0432\u0443\u0445\u043c\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e x&gt;= 0, y&gt;=0.<\/p>\n<p>  \u0417\u0430\u043f\u0438\u0448\u0435\u043c hash \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0442\u043e\u0447\u043a\u0438 P1 (x1, y1):  <\/p>\n<blockquote><p>(p*q + x1)*q + y1 = h  <\/p><\/blockquote>\n<p>  h \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 hash \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u0442\u043e\u0447\u043a\u0443 P2(x2, y2) \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u0436\u0435 hash \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0422\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u043b\u0443\u0447\u0430\u0439 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0438:  <\/p>\n<blockquote><p>(p*q + x2)*q + y2 = h  <\/p><\/blockquote>\n<p>  \u0412\u044b\u0447\u0442\u0435\u043c \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0435:  <\/p>\n<blockquote><p>q(x1-x2) + y1 \u2014 y2 = 0 (\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 p \u043f\u0440\u043e\u043f\u0430\u043b \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u044f)  <\/p><\/blockquote>\n<p>  \u0412\u044b\u043d\u0435\u0441\u0435\u043c q \u0432 \u043f\u0440\u0430\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c:  <\/p>\n<blockquote><p>(x1 \u2014 x2) \/ (y2-y1) = q (\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u0435\u043d \u043e\u0442 \u043d\u0443\u043b\u044f)  <\/p><\/blockquote>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f x1, x2, y1, y2, \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e, \u0442\u043e \u044d\u0442\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 hash \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u044f.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<blockquote><p>x1 = 38<br \/>  x2 = 1<br \/>  y2= 2<br \/>  y1 = 1  <\/p><\/blockquote>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0438 P(38, 1) \u0438 P(1, 2) \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 hashCode\u2026 \u042f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0438\u043c\u0435\u044f 4 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f hash \u043a\u043e\u0434\u0430, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439 \u0445\u043e\u0442\u044f \u0431\u044b \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435 100&#215;100!<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439 n \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043e\u0442 0 \u0434\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e M. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 M, \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f hashCode \u043d\u0435 \u0438\u043c\u0435\u043b\u0430 \u0431\u044b \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439 \u043d\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0435 \u043e\u0442 0 \u0434\u043e M \u043f\u043e \u0432\u0441\u0435\u043c n \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f M:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/746\/110\/4c4\/7461104c4dc89bdf845b604879d9b105.gif\"\/><br \/>  \u0414\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438 M \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 65536.<\/p>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0430, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0411\u043b\u043e\u0445\u043e\u043c, \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 hash \u043a\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f 8 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0447\u043a\u0438 \u0432 \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0442\u0440\u043e\u0439\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u0442\u043e\u0447\u043a\u0438 \u043e\u0442 0 \u0434\u043e 100 (\u0432\u0441\u0435\u0433\u043e \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u0442\u043e\u0447\u0435\u043a) \u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439. \u041a\u043e\u0434 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0431\u0443\u0434\u0443 \u0435\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b 901692 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439! \u0422\u043e \u0435\u0441\u0442\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435, \u0447\u0435\u043c 90%. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0411\u043b\u043e\u0445, \u043f\u043e\u0434 \u0432\u0438\u0434\u043e\u043c hash \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439? <\/p>\n<h2>\u0425\u043e\u0440\u043e\u0448\u0438\u0439 hashCode \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f \u0434\u0432\u0443\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/h2>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f \u0434\u0432\u0443\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (x1, y1). \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043a\u0438\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f x1 \u0438 y1 \u043d\u0430 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\u043c: \u0443\u043c\u043d\u043e\u0436\u0438\u043c x1 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0447\u0438\u0441\u043b\u043e p, \u0430 y1 \u2014 \u043d\u0430 q. \u041f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043d\u0430 p \u0438 q \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f hash \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u043b\u043e\u0436\u0438\u043c \u044d\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f:  <\/p>\n<blockquote><p>p*x1+q*y1=h  <\/p><\/blockquote>\n<p>  \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0440\u0438\u0451\u043c\u043e\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435: \u043d\u0430\u0439\u0434\u0435\u043c x2, y2, \u0442\u0430\u043a\u0438\u0435, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 hash \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0434\u0430\u0441\u0442 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u044e.  <\/p>\n<blockquote><p>p*x2+q*y2=h  <\/p><\/blockquote>\n<p>  \u0412\u044b\u0447\u0442\u0435\u043c \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u0432\u0442\u043e\u0440\u043e\u0435:  <\/p>\n<blockquote><p>p*(x1-x2) + q(y1-y2) = 0<br \/>  \u0438\u043b\u0438<br \/>  (x1-x2)\/(y2-y1)=q\/p (\u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e)  <\/p><\/blockquote>\n<p>  \u0415\u0441\u043b\u0438 q \u0432\u0437\u044f\u0442\u044c \u0440\u0430\u0432\u043d\u044b\u043c 37, \u0430 p \u2014 1, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043e\u0442 \u0411\u043b\u043e\u0445\u0430.<br \/>  \u0418\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0438 \u0438\u0437 \u0442\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u0430, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u0441\u043b\u0435\u0434\u0443\u0435\u0442:<br \/>  1) \u0420\u0430\u0437\u043d\u043e\u0441\u0442\u044c (x1-x2) \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430 q, \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c (y2-y1) \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430 p.<br \/>  2) \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 p \u0438 q, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u0447\u043a\u0430\u043c\u0438.<br \/>  3) p \u0438 q \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438.<br \/>  4) \u0418\u043c\u0435\u044f \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 h=2<sup>32<\/sup>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0439 p*x1, q*y1 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c 2<sup>32<\/sup>\/2. \u041e\u0442\u0441\u044e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e p \u0438 q \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 32768. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 32765 \u0438 32767 \u0422\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u043d\u0430\u0448\u0435\u043c \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0438: \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043c\u044b \u043e\u043a\u0430\u0436\u0435\u043c\u0441\u044f \u0432 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u043e\u0441\u0438. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u043e\u0440\u0430\u0437\u043c\u044b\u0441\u043b\u0438\u0442\u044c \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e<\/p>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>  \u041a\u0430\u043a \u043f\u0438\u0441\u0430\u043b \u0414\u043e\u043d\u0430\u043b\u044c\u0434 \u041a\u043d\u0443\u0442 \u0432 \u0433\u043b\u0430\u0432\u0435 \u043f\u0440\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0441\u0435\u0432\u0434\u043e\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439, \u0435\u0441\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e, \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e (\u043d\u0435\u0434\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435).<\/p>\n<p>  \u0422\u0435 \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e hash \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442 \u0414\u0436\u043e\u0448\u0443\u0430 \u0411\u043b\u043e\u0445\u0430, \u043d\u043e \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0445\u0435\u0448\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043c\u043e\u0433\u0443\u0442 \u0441\u043f\u0430\u0442\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e. \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0432\u043e\u043b\u043d\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0435, \u0443 \u043a\u043e\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 Hash-\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0443\u0437\u043a\u0438\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b \u0431\u044c\u0435\u0442\u0435\u0441\u044c \u0437\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043c\u0435\u043b\u043e\u0447\u0438, \u0442\u043e \u0432\u0430\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 hashCode() \u0441\u0432\u0435\u0436\u0438\u043c \u0432\u0437\u0433\u043b\u044f\u0434\u043e\u043c. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0445\u0435\u0448\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c hash \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c hash \u043a\u043e\u0434\u043e\u0432, \u0447\u0435\u043c \u043b\u044e\u0431\u043e\u0439 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0432 hashCode(), \u0432\u0430\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 equals(): \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 false.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0442\u0435\u043c, \u043a\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<p>  \u041b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430:<br \/>  Bruce Eckel \u201cThinking in Java Third Edition\u201d<br \/>  Joshua Bloch \u201cEffective Java: Programming Language Guide\u201d \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/169733\/\"> http:\/\/habrahabr.ru\/post\/169733\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0427\u0430\u0441\u0442\u043e \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e hashCode().<br \/>  \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0437\u0434\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0435\u0435 \u0441\u0432\u044f\u0437\u044c \u0441 \u0434\u0440\u0443\u0433\u043e\u0439, \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 equals(). \u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430\u0445 \u043f\u043e Java \u0438 \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u0435\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c. \u041c\u043d\u0435 \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043b\u0438\u0448\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435: hashCode \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u042f \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f: \u201c\u0410 \u0447\u0435\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435?\u201d<\/p>\n<p>  \u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c. \u041c\u043d\u0435 \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438, \u0435\u0441\u043b\u0438 \u044f \u0433\u0434\u0435-\u0442\u043e \u043e\u0448\u0438\u0431\u0441\u044f \u0432 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f\u0445.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-169733","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/169733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=169733"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/169733\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}