{"id":27708,"date":"2024-11-24T09:57:33","date_gmt":"2024-11-24T01:57:33","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27708\/"},"modified":"2024-11-24T09:57:33","modified_gmt":"2024-11-24T01:57:33","slug":"koa-%e4%b8%ad-md5-update-%e4%bc%a0%e9%80%92%e5%8f%98%e9%87%8f%e5%bc%95%e5%8f%91-internal-server-error-%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27708\/","title":{"rendered":"koa \u4e2d md5.update \u4f20\u9012\u53d8\u91cf\u5f15\u53d1 Internal Server Error \u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173130715219015.jpg\" class=\"aligncenter\" title=\"koa \u4e2d md5.update \u4f20\u9012\u53d8\u91cf\u5f15\u53d1 Internal Server Error \u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"koa \u4e2d md5.update \u4f20\u9012\u53d8\u91cf\u5f15\u53d1 Internal Server Error \u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>koa md5.update \u4f20\u9012\u53d8\u91cf\u5f15\u53d1 internal server error<\/strong><\/p>\n<p>\u5728 koa \u4e2d\u4f7f\u7528 md5.update \u51fd\u6570\u5bf9\u53d8\u91cf\u8fdb\u884c\u54c8\u5e0c\u5904\u7406\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230 internal server error \u9519\u8bef\u3002\u8fd9\u662f\u56e0\u4e3a md5.update \u9700\u8981\u4e00\u4e2a buffer \u7c7b\u578b\u7684\u6570\u636e\u4f5c\u4e3a\u8f93\u5165\uff0c\u800c\u4f20\u9012\u4e00\u4e2a\u5b57\u7b26\u4e32\u53d8\u91cf\u4f1a\u5f15\u53d1\u9519\u8bef\u3002<\/p>\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528 password.tostring() \u65b9\u6cd5\u5c06\u5bc6\u7801\u53d8\u91cf\u8f6c\u6362\u4e3a buffer \u7c7b\u578b\u3002\u5177\u4f53\u505a\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>const md5 = crypto.createHash('md5');\nconst result = md5.update(password.toString()).digest('hex');<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u73b0\u5728\uff0c\u4f20\u9012\u53d8\u91cf password \u5373\u53ef\u6b63\u786e\u751f\u6210\u54c8\u5e0c\u503c\uff0c\u800c\u4e0d\u4f1a\u518d\u51fa\u73b0 internal server error \u9519\u8bef\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fkoa \u4e2d md5.update \u4f20\u9012\u53d8\u91cf\u5f15\u53d1 Internal Server Error \u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>koa md5.update \u4f20\u9012\u53d8\u91cf\u5f15\u53d1 internal server error \u5728 koa \u4e2d\u4f7f\u7528 md5.update \u51fd\u6570\u5bf9\u53d8\u91cf\u8fdb\u884c\u54c8\u5e0c\u5904\u7406\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230 internal server error \u9519\u8bef\u3002\u8fd9\u662f\u56e0\u4e3a md5.update \u9700\u8981\u4e00\u4e2a buffer \u7c7b\u578b\u7684\u6570\u636e\u4f5c\u4e3a\u8f93\u5165\uff0c\u800c\u4f20\u9012\u4e00\u4e2a\u5b57\u7b26\u4e32\u53d8\u91cf\u4f1a\u5f15\u53d1\u9519\u8bef\u3002 \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528 password.tostring() \u65b9\u6cd5\u5c06\u5bc6\u7801\u53d8\u91cf\u8f6c\u6362\u4e3a buffer \u7c7b\u578b\u3002\u5177\u4f53\u505a\u6cd5\u5982\u4e0b\uff1a const md5 = crypto.createHash(&#8216;md5&#8217;); const result = md5.update(password.toString()).digest(&#8216;hex&#8217;); \u767b\u5f55\u540e\u590d\u5236 \u73b0\u5728\uff0c\u4f20\u9012\u53d8\u91cf password \u5373\u53ef\u6b63\u786e\u751f\u6210\u54c8\u5e0c\u503c\uff0c\u800c\u4e0d\u4f1a\u518d\u51fa\u73b0 internal server error \u9519\u8bef\u3002 \u4ee5\u4e0a\u5c31\u662fkoa \u4e2d md5.update \u4f20\u9012\u53d8\u91cf\u5f15\u53d1 Internal Server Error \u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27708","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27708"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27708\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}