{"id":383008,"date":"2024-06-29T04:38:11","date_gmt":"2024-06-29T04:38:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=383008"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=383008","title":{"rendered":"<span>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u00ab\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432\u00bb \u0438\u043b\u0438 \u043a\u0430\u043a \u0441\u0436\u0430\u0442\u044c csv-\u0444\u0430\u0439\u043b \u0432 38 \u0440\u0430\u0437<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 csv: <a href=\"http:\/\/%D1%81%D0%B5%D1%80%D0%B2%D0%B8%D1%81%D1%8B.%D0%B3%D1%83%D0%B2%D0%BC.%D0%BC%D0%B2%D0%B4.%D1%80%D1%84\/info-service.htm?sid=2000\" rel=\"noopener noreferrer nofollow\">http:\/\/\u0441\u0435\u0440\u0432\u0438\u0441\u044b.\u0433\u0443\u0432\u043c.\u043c\u0432\u0434.\u0440\u0444\/info-service.htm?sid=2000<\/a>. \u0420\u0430\u0437\u043c\u0435\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 <code>list_of_expired_passports.csv.bz2<\/code> \u2014 <strong>506 MB<\/strong>, \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e csv-\u0444\u0430\u0439\u043b\u0430 \u2014 <strong>1,6 GB<\/strong>.<\/p>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 REST-\u0441\u0435\u0440\u0432\u0438\u0441, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438: <\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 (\u0421\u0435\u0440\u0438\u044f + \u041d\u043e\u043c\u0435\u0440) \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432. <\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 csv-\u0444\u0430\u0439\u043b\u0430<\/h2>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 csv-\u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 <strong>137 148 000<\/strong> \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>^\\d{4},\\d{6}$<\/code>, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0438 \u0431\u0443\u043a\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0438\u0438 (~10000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439).<\/p>\n<pre><code class=\"bash\">PASSP_SERIES,PASSP_NUMBER 6004,270563 6004,270579 6004,270611 ... \u0425\u0415\u04206,37039 \u0425\u0418\u0411\u0410,601006 \u0425\u0423\u0415\u0420,685239 \u042f\u041301,3332<\/code><\/pre>\n<h2>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 csv-\u0444\u0430\u0439\u043b, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438?<\/h2>\n<p>\u0414\u0430! \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0447\u0442\u043e \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438, \u0434\u0430\u043d\u043d\u044b\u0439 csv-\u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0432\u0430\u0442\u043e\u0440\u044b. \u0410 \u0442\u043e\u0447\u043d\u0435\u0435 \u2013 \u0434\u043e <strong>42 MB<\/strong>, \u0447\u0442\u043e \u0432 <strong>38 \u0440\u0430\u0437<\/strong> \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e csv-\u0444\u0430\u0439\u043b\u0430 \u0438 \u0432 <strong>11 \u0440\u0430\u0437<\/strong> \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435 csv-\u0444\u0430\u0439\u043b\u0430 \u0441\u0436\u0430\u0442\u043e\u0433\u043e bzip2.<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0430 16.08.2021.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B8.%D0%B3%D1%83%D0%B2%D0%BC.%D0%BC%D0%B2%D0%B4.%D1%80%D1%84\/upload\/expired-passports\/list_of_expired_passports.csv.bz2\" rel=\"noopener noreferrer nofollow\">https:\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.\u0433\u0443\u0432\u043c.\u043c\u0432\u0434.\u0440\u0444\/upload\/expired-passports\/list_of_expired_passports.csv.bz2<\/a><\/p>\n<\/li>\n<\/ul>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>\u0424\u043e\u0440\u043c\u0430\u0442<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"223\" width=\"223\">\n<p><strong>\u0420\u0430\u0437\u043c\u0435\u0440 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>list_of_expired_passports.csv.bz2<\/p>\n<\/td>\n<td data-colwidth=\"223\" width=\"223\">\n<p>506,340,184<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>list_of_expired_passports.csv<\/p>\n<\/td>\n<td data-colwidth=\"223\" width=\"223\">\n<p>1,649,037,938<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>list_of_expired_passports.csv.pdata<\/p>\n<\/td>\n<td data-colwidth=\"223\" width=\"223\">\n<p>42,876,427<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0436\u0430\u0442\u0438\u044f .pdata (passport data)<\/h2>\n<p>\u0425\u043e\u0447\u0443 \u0441\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u0436\u0430\u0442\u0438\u044f csv-\u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 csv-\u0444\u0430\u0439\u043b\u0430: <code>6004,270563<\/code>.<\/p>\n<ol>\n<li>\n<p>\u0423\u0434\u0430\u043b\u0438\u043c \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0438\u0435\u0439 \u0438 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e 7 \u0438 3 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u0432\u0438\u0434\u0435 \u0447\u0438\u0441\u0435\u043b: <code>6004270<\/code> \u0438 <code>563<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>Int32<\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 <code>Dictionary&lt;int, byte[]><\/code> \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0447\u0438\u0441\u0435\u043b \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 7 \u0446\u0438\u0444\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435 3-\u0437\u043d\u0430\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 999. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0435\u0441\u0442\u044c \u043b\u0438 \u043e\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 999 \u0431\u0443\u0434\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0438\u0437 1000 \u0431\u0438\u0442, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0438\u0437 125 \u0431\u0430\u0439\u0442.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/854\/0e2\/525\/8540e2525e49b935a90b33f0924dda7f.jfif\" alt=\"\" title=\"\" width=\"969\" height=\"215\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0436\u0430\u0442\u0438\u044f<\/h2>\n<h3>PassportDataStorage.cs<\/h3>\n<pre><code class=\"cs\">using System; using System.Collections.Generic; using System.Linq;  namespace FileFormat.PassportData {     public class PassportDataStorage     {         private const int PART1_LENGTH = 7;         private const int PART2_LENGTH = 3;         public const int PART2_NUM_VALUES = 1000;          private readonly IBitMatrix _numbers;         private readonly ISet&lt;string> _strings;          public PassportDataStorage()         {             _numbers = new BitMatrix(PART2_NUM_VALUES);             _strings = new HashSet&lt;string>();         }          public PassportDataStorage(IBitMatrix numbers, IEnumerable&lt;string> strings)         {             _numbers = numbers;             _strings = new HashSet&lt;string>(strings);         }                  public string Header { get; set; }          public ISet&lt;string> Strings => _strings;          public IBitMatrix Numbers => _numbers;                  public void Add(string value)         {             if (string.IsNullOrEmpty(value))             {                 return;             }              if (IsOnlyNumbers(value))             {                 var (row, column) = SplitNumbersValue(value);                 _numbers[row, column] = true;             }             else             {                 _strings.Add(value);             }         }          public bool Contains(string value)         {             if (string.IsNullOrEmpty(value))             {                 throw new ArgumentNullException(nameof(value));             }              bool result;             if (IsOnlyNumbers(value))             {                 var (row, column) = SplitNumbersValue(value);                 result = _numbers[row, column];             }             else             {                 result = _strings.Contains(value);             }              return result;         }          private bool IsOnlyNumbers(string value)         {             if (value.Length == 11 &amp;&amp; value[4] == ',')             {                 var numbers = value.Substring(0, 4) + value.Substring(5, 6);                 return numbers.All(char.IsDigit);             }              return false;         }          private (int, int) SplitNumbersValue(string value)         {             var onlyNumbers = value.Substring(0, 4) + value.Substring(5, 6);             var part1 = onlyNumbers.Substring(0, PART1_LENGTH);             var part2 = onlyNumbers.Substring(PART1_LENGTH, PART2_LENGTH);             return (int.Parse(part1), int.Parse(part2));         }     } }<\/code><\/pre>\n<h3>protobuf-\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0444\u0430\u0439\u043b\u0430 .pdata (passportdata.proto)<\/h3>\n<pre><code class=\"bash\">syntax = \"proto3\";  message PassportDataMessage {     string csv_header = 1;     repeated NumbersMap numbers_only_map = 2;     repeated string other_lines = 3; }  message NumbersMap {     int32 seven_digits_key = 1;     bytes three_digits_bits_value = 2; } <\/code><\/pre>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0418\u0434\u0435\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0436\u0430\u0442\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 <code>PassportDataStorage<\/code>. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e 1 \u0440\u0430\u0437 \u0432 \u0441\u0443\u0442\u043a\u0438. \u041c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/hub.docker.com\/r\/skivsoft\/expired-passport-checker\" rel=\"noopener noreferrer nofollow\">docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430 Docker Hub<\/a>. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0430 .NET Core, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 GitHub.<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p><code>docker pull skivsoft\/expired-passport-checker<\/code><\/p>\n<\/li>\n<li>\n<p><code>docker run -it --rm -p 8000:80 --name expiredpassportchecker skivsoft\/expired-passport-checker<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u043a\u0440\u044b\u0432\u0430\u0435\u043c Swager UI <a href=\"http:\/\/localhost:8000\/swagger\/\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8000\/swagger\/<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0432\u0430 bzip2<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 csv-\u0444\u0430\u0439\u043b\u0430 \u0438\u0437 bzip2 \u0430\u0440\u0445\u0438\u0432\u0430<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 csv-\u0444\u0430\u0439\u043b\u0430 \u0432 \u0441\u0436\u0430\u0442\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 PassportData \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <code>CronSchedule<\/code> \u0432 <a href=\"https:\/\/github.com\/skivsoft\/ExpiredPassportChecker\/blob\/main\/src\/ExpiredPassportChecker\/appsettings.json\" rel=\"noopener noreferrer nofollow\">appsettings.json<\/a>.<\/p>\n<h2>\u041b\u043e\u0433 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>UPD: 21.08.2021<\/p>\n<pre><code class=\"bash\">[23:44:05 INF] Step 1 of 4: DownloadBzip2 [23:44:05 INF] Downloading file https:\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.\u0433\u0443\u0432\u043c.\u043c\u0432\u0434.\u0440\u0444\/upload\/expired-passports\/list_of_expired_passports.csv.bz2 [\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588] 00:00:00 [23:47:17 INF] Downloaded 506.64 MB (506639004 bytes) 2.64 MB\/s [23:47:17 INF] Elapsed time: 00:03:12.2394834 [23:47:17 INF] -------------------------------------------------------------------------------- [23:47:17 INF] Step 2 of 4: UnpackFromBzip2 [23:47:17 INF] Unpacking list_of_expired_passports.csv.bz2 into list_of_expired_passports.csv [23:48:52 INF] Unpacked 1,650.19 MB (1650187286 bytes) [23:48:52 INF] Elapsed time: 00:01:34.3357428 [23:48:52 INF] -------------------------------------------------------------------------------- [23:48:52 INF] Step 3 of 4: PackCsvToPassportData [23:48:52 INF] Reading and compressing list_of_expired_passports.csv [23:49:44 INF] Number of processed records: 137514593 [23:49:44 INF] Number of lines with letters: 10094 [23:49:44 INF] Elapsed time: 00:00:52.2790392 [23:49:44 INF] -------------------------------------------------------------------------------- [23:49:44 INF] Step 4 of 4: SavePassportData [23:49:44 INF] Packed passport data saved into list_of_expired_passports.csv.pdata (40.15 MB) [23:49:44 INF] Elapsed time: 00:00:00.2261993 [23:49:44 INF] -------------------------------------------------------------------------------- [23:49:44 INF] Total elapsed time: 00:05:39.0804647 [23:49:44 INF] -------------------------------------------------------------------------------- <\/code><\/pre>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<ul>\n<li>\n<p><a href=\"http:\/\/%D1%81%D0%B5%D1%80%D0%B2%D0%B8%D1%81%D1%8B.%D0%B3%D1%83%D0%B2%D0%BC.%D0%BC%D0%B2%D0%B4.%D1%80%D1%84\/info-service.htm?sid=2000\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/skivsoft\/ExpiredPassportChecker\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 GitHub<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/hub.docker.com\/r\/skivsoft\/expired-passport-checker\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/573974\/\"> https:\/\/habr.com\/ru\/articles\/573974\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 csv: <a href=\"http:\/\/%D1%81%D0%B5%D1%80%D0%B2%D0%B8%D1%81%D1%8B.%D0%B3%D1%83%D0%B2%D0%BC.%D0%BC%D0%B2%D0%B4.%D1%80%D1%84\/info-service.htm?sid=2000\" rel=\"noopener noreferrer nofollow\">http:\/\/\u0441\u0435\u0440\u0432\u0438\u0441\u044b.\u0433\u0443\u0432\u043c.\u043c\u0432\u0434.\u0440\u0444\/info-service.htm?sid=2000<\/a>. \u0420\u0430\u0437\u043c\u0435\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 <code>list_of_expired_passports.csv.bz2<\/code> \u2014 <strong>506 MB<\/strong>, \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e csv-\u0444\u0430\u0439\u043b\u0430 \u2014 <strong>1,6 GB<\/strong>.<\/p>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 REST-\u0441\u0435\u0440\u0432\u0438\u0441, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438: <\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 (\u0421\u0435\u0440\u0438\u044f + \u041d\u043e\u043c\u0435\u0440) \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432. <\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 csv-\u0444\u0430\u0439\u043b\u0430<\/h2>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 csv-\u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 <strong>137 148 000<\/strong> \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>^\\d{4},\\d{6}$<\/code>, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0438 \u0431\u0443\u043a\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0438\u0438 (~10000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439).<\/p>\n<pre><code class=\"bash\">PASSP_SERIES,PASSP_NUMBER 6004,270563 6004,270579 6004,270611 ... \u0425\u0415\u04206,37039 \u0425\u0418\u0411\u0410,601006 \u0425\u0423\u0415\u0420,685239 \u042f\u041301,3332<\/code><\/pre>\n<h2>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 csv-\u0444\u0430\u0439\u043b, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438?<\/h2>\n<p>\u0414\u0430! \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0447\u0442\u043e \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438, \u0434\u0430\u043d\u043d\u044b\u0439 csv-\u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0432\u0430\u0442\u043e\u0440\u044b. \u0410 \u0442\u043e\u0447\u043d\u0435\u0435 \u2013 \u0434\u043e <strong>42 MB<\/strong>, \u0447\u0442\u043e \u0432 <strong>38 \u0440\u0430\u0437<\/strong> \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e csv-\u0444\u0430\u0439\u043b\u0430 \u0438 \u0432 <strong>11 \u0440\u0430\u0437<\/strong> \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435 csv-\u0444\u0430\u0439\u043b\u0430 \u0441\u0436\u0430\u0442\u043e\u0433\u043e bzip2.<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0430 16.08.2021.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B8.%D0%B3%D1%83%D0%B2%D0%BC.%D0%BC%D0%B2%D0%B4.%D1%80%D1%84\/upload\/expired-passports\/list_of_expired_passports.csv.bz2\" rel=\"noopener noreferrer nofollow\">https:\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.\u0433\u0443\u0432\u043c.\u043c\u0432\u0434.\u0440\u0444\/upload\/expired-passports\/list_of_expired_passports.csv.bz2<\/a><\/p>\n<\/li>\n<\/ul>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>\u0424\u043e\u0440\u043c\u0430\u0442<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"223\" width=\"223\">\n<p><strong>\u0420\u0430\u0437\u043c\u0435\u0440 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>list_of_expired_passports.csv.bz2<\/p>\n<\/td>\n<td data-colwidth=\"223\" width=\"223\">\n<p>506,340,184<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>list_of_expired_passports.csv<\/p>\n<\/td>\n<td data-colwidth=\"223\" width=\"223\">\n<p>1,649,037,938<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>list_of_expired_passports.csv.pdata<\/p>\n<\/td>\n<td data-colwidth=\"223\" width=\"223\">\n<p>42,876,427<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0436\u0430\u0442\u0438\u044f .pdata (passport data)<\/h2>\n<p>\u0425\u043e\u0447\u0443 \u0441\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u0436\u0430\u0442\u0438\u044f csv-\u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 csv-\u0444\u0430\u0439\u043b\u0430: <code>6004,270563<\/code>.<\/p>\n<ol>\n<li>\n<p>\u0423\u0434\u0430\u043b\u0438\u043c \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0438\u0435\u0439 \u0438 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e 7 \u0438 3 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u0432\u0438\u0434\u0435 \u0447\u0438\u0441\u0435\u043b: <code>6004270<\/code> \u0438 <code>563<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>Int32<\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 <code>Dictionary&lt;int, byte[]><\/code> \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0447\u0438\u0441\u0435\u043b \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 7 \u0446\u0438\u0444\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435 3-\u0437\u043d\u0430\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 999. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0435\u0441\u0442\u044c \u043b\u0438 \u043e\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 999 \u0431\u0443\u0434\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0438\u0437 1000 \u0431\u0438\u0442, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0438\u0437 125 \u0431\u0430\u0439\u0442.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0436\u0430\u0442\u0438\u044f<\/h2>\n<h3>PassportDataStorage.cs<\/h3>\n<pre><code class=\"cs\">using System; using System.Collections.Generic; using System.Linq;  namespace FileFormat.PassportData {     public class PassportDataStorage     {         private const int PART1_LENGTH = 7;         private const int PART2_LENGTH = 3;         public const int PART2_NUM_VALUES = 1000;          private readonly IBitMatrix _numbers;         private readonly ISet&lt;string> _strings;          public PassportDataStorage()         {             _numbers = new BitMatrix(PART2_NUM_VALUES);             _strings = new HashSet&lt;string>();         }          public PassportDataStorage(IBitMatrix numbers, IEnumerable&lt;string> strings)         {             _numbers = numbers;             _strings = new HashSet&lt;string>(strings);         }                  public string Header { get; set; }          public ISet&lt;string> Strings => _strings;          public IBitMatrix Numbers => _numbers;                  public void Add(string value)         {             if (string.IsNullOrEmpty(value))             {                 return;             }              if (IsOnlyNumbers(value))             {                 var (row, column) = SplitNumbersValue(value);                 _numbers[row, column] = true;             }             else             {                 _strings.Add(value);             }         }          public bool Contains(string value)         {             if (string.IsNullOrEmpty(value))             {                 throw new ArgumentNullException(nameof(value));             }              bool result;             if (IsOnlyNumbers(value))             {                 var (row, column) = SplitNumbersValue(value);                 result = _numbers[row, column];             }             else             {                 result = _strings.Contains(value);             }              return result;         }          private bool IsOnlyNumbers(string value)         {             if (value.Length == 11 &amp;&amp; value[4] == ',')             {                 var numbers = value.Substring(0, 4) + value.Substring(5, 6);                 return numbers.All(char.IsDigit);             }              return false;         }          private (int, int) SplitNumbersValue(string value)         {             var onlyNumbers = value.Substring(0, 4) + value.Substring(5, 6);             var part1 = onlyNumbers.Substring(0, PART1_LENGTH);             var part2 = onlyNumbers.Substring(PART1_LENGTH, PART2_LENGTH);             return (int.Parse(part1), int.Parse(part2));         }     } }<\/code><\/pre>\n<h3>protobuf-\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0444\u0430\u0439\u043b\u0430 .pdata (passportdata.proto)<\/h3>\n<pre><code class=\"bash\">syntax = \"proto3\";  message PassportDataMessage {     string csv_header = 1;     repeated NumbersMap numbers_only_map = 2;     repeated string other_lines = 3; }  message NumbersMap {     int32 seven_digits_key = 1;     bytes three_digits_bits_value = 2; } <\/code><\/pre>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0418\u0434\u0435\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0436\u0430\u0442\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 <code>PassportDataStorage<\/code>. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e 1 \u0440\u0430\u0437 \u0432 \u0441\u0443\u0442\u043a\u0438. \u041c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/hub.docker.com\/r\/skivsoft\/expired-passport-checker\" rel=\"noopener noreferrer nofollow\">docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430 Docker Hub<\/a>. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0430 .NET Core, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 GitHub.<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p><code>docker pull skivsoft\/expired-passport-checker<\/code><\/p>\n<\/li>\n<li>\n<p><code>docker run -it --rm -p 8000:80 --name expiredpassportchecker skivsoft\/expired-passport-checker<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u043a\u0440\u044b\u0432\u0430\u0435\u043c Swager UI <a href=\"http:\/\/localhost:8000\/swagger\/\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8000\/swagger\/<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0432\u0430 bzip2<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 csv-\u0444\u0430\u0439\u043b\u0430 \u0438\u0437 bzip2 \u0430\u0440\u0445\u0438\u0432\u0430<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 csv-\u0444\u0430\u0439\u043b\u0430 \u0432 \u0441\u0436\u0430\u0442\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 PassportData \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <code>CronSchedule<\/code> \u0432 <a href=\"https:\/\/github.com\/skivsoft\/ExpiredPassportChecker\/blob\/main\/src\/ExpiredPassportChecker\/appsettings.json\" rel=\"noopener noreferrer nofollow\">appsettings.json<\/a>.<\/p>\n<h2>\u041b\u043e\u0433 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>UPD: 21.08.2021<\/p>\n<pre><code class=\"bash\">[23:44:05 INF] Step 1 of 4: DownloadBzip2 [23:44:05 INF] Downloading file https:\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.\u0433\u0443\u0432\u043c.\u043c\u0432\u0434.\u0440\u0444\/upload\/expired-passports\/list_of_expired_passports.csv.bz2 [\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588] 00:00:00 [23:47:17 INF] Downloaded 506.64 MB (506639004 bytes) 2.64 MB\/s [23:47:17 INF] Elapsed time: 00:03:12.2394834 [23:47:17 INF] -------------------------------------------------------------------------------- [23:47:17 INF] Step 2 of 4: UnpackFromBzip2 [23:47:17 INF] Unpacking list_of_expired_passports.csv.bz2 into list_of_expired_passports.csv [23:48:52 INF] Unpacked 1,650.19 MB (1650187286 bytes) [23:48:52 INF] Elapsed time: 00:01:34.3357428 [23:48:52 INF] -------------------------------------------------------------------------------- [23:48:52 INF] Step 3 of 4: PackCsvToPassportData [23:48:52 INF] Reading and compressing list_of_expired_passports.csv [23:49:44 INF] Number of processed records: 137514593 [23:49:44 INF] Number of lines with letters: 10094 [23:49:44 INF] Elapsed time: 00:00:52.2790392 [23:49:44 INF] -------------------------------------------------------------------------------- [23:49:44 INF] Step 4 of 4: SavePassportData [23:49:44 INF] Packed passport data saved into list_of_expired_passports.csv.pdata (40.15 MB) [23:49:44 INF] Elapsed time: 00:00:00.2261993 [23:49:44 INF] -------------------------------------------------------------------------------- [23:49:44 INF] Total elapsed time: 00:05:39.0804647 [23:49:44 INF] -------------------------------------------------------------------------------- <\/code><\/pre>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<ul>\n<li>\n<p><a href=\"http:\/\/%D1%81%D0%B5%D1%80%D0%B2%D0%B8%D1%81%D1%8B.%D0%B3%D1%83%D0%B2%D0%BC.%D0%BC%D0%B2%D0%B4.%D1%80%D1%84\/info-service.htm?sid=2000\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u043e\u0432<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/skivsoft\/ExpiredPassportChecker\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 GitHub<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/hub.docker.com\/r\/skivsoft\/expired-passport-checker\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/573974\/\"> https:\/\/habr.com\/ru\/articles\/573974\/<\/a><br \/><\/br><\/br><\/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-383008","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/383008","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=383008"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/383008\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=383008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=383008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=383008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}