"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[3455],{915:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>o,contentTitle:()=>t,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>a});const l=JSON.parse('{"id":"XXTLanControl.lua/web-file/crc32","title":"\u8ba1\u7b97\u6587\u4ef6 CRC32 (LCC.web_file.crc32)","description":"\u58f0\u660e","source":"@site/docs/XXTLanControl.lua/web-file/crc32.md","sourceDirName":"XXTLanControl.lua/web-file","slug":"/XXTLanControl.lua/web-file/crc32","permalink":"/docs/XXTLanControl.lua/web-file/crc32","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":80,"frontMatter":{"sidebar_position":80},"sidebar":"tutorialSidebar","previous":{"title":"\u8ba1\u7b97\u6587\u4ef6 SHA1 (LCC.web_file.sha1)","permalink":"/docs/XXTLanControl.lua/web-file/sha1"},"next":{"title":"\u8bfb\u53d6\u4e2d\u63a7\u6587\u4ef6\u5185\u5bb9 (LCC.web_file.reads)","permalink":"/docs/XXTLanControl.lua/web-file/reads"}}');var c=r(4848),i=r(8453);const s={sidebar_position:80},t="\u8ba1\u7b97\u6587\u4ef6 CRC32 (LCC.web_file.crc32)",o={},a=[{value:"\u58f0\u660e",id:"\u58f0\u660e",level:2},{value:"\u53c2\u6570",id:"\u53c2\u6570",level:2},{value:"\u8fd4\u56de\u503c",id:"\u8fd4\u56de\u503c",level:2},{value:"\u8bf4\u660e",id:"\u8bf4\u660e",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function d(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.header,{children:(0,c.jsx)(n.h1,{id:"\u8ba1\u7b97\u6587\u4ef6-crc32-lccweb_filecrc32",children:"\u8ba1\u7b97\u6587\u4ef6 CRC32 (LCC.web_file.crc32)"})}),"\n",(0,c.jsx)(n.h2,{id:"\u58f0\u660e",children:"\u58f0\u660e"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-lua",children:"checksum, err = LCC.web_file.crc32(path, timeout?)\n"})}),"\n",(0,c.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:["path",(0,c.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\uff0c\u5f85\u6821\u9a8c\u7684\u6587\u4ef6\u8def\u5f84"]}),"\n",(0,c.jsxs)(n.li,{children:["timeout",(0,c.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u53ef\u9009\uff1b\u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"60"})]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"\u8fd4\u56de\u503c",children:"\u8fd4\u56de\u503c"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:["checksum",(0,c.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\uff0c8 \u4f4d\u5341\u516d\u8fdb\u5236 CRC32\uff1b\u5931\u8d25\u65f6\u4e3a ",(0,c.jsx)(n.code,{children:"nil"})]}),"\n",(0,c.jsxs)(n.li,{children:["err",(0,c.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\u6216 ",(0,c.jsx)(n.code,{children:"nil"}),"\uff0c\u5931\u8d25\u65f6\u7684\u9519\u8bef\u63cf\u8ff0"]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"\u8bf4\u660e",children:"\u8bf4\u660e"}),"\n",(0,c.jsxs)(n.blockquote,{children:["\n",(0,c.jsxs)(n.p,{children:["\u7531\u4e2d\u63a7\u4fa7\u8ba1\u7b97\u6587\u4ef6\u7684 CRC32 \u6821\u9a8c\u503c\u3002",(0,c.jsx)(n.br,{}),"\n","\u9002\u5408\u5feb\u901f\u68c0\u6d4b\u6587\u4ef6\u5b8c\u6574\u6027\u3002"]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-lua",children:'local crc32, err = LCC.web_file.crc32("/\u56fa\u4ef6/patch.bin")\nif crc32 then\n    print("CRC32=" .. crc32)\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>t});var l=r(6540);const c={},i=l.createContext(c);function s(e){const n=l.useContext(i);return l.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),l.createElement(i.Provider,{value:n},e.children)}}}]);