"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[5577],{325:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>s,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"XXTLanControl.lua/web-file/md5","title":"Calculate File MD5 (LCC.web_file.md5)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/web-file/md5.md","sourceDirName":"XXTLanControl.lua/web-file","slug":"/XXTLanControl.lua/web-file/md5","permalink":"/docs/en/XXTLanControl.lua/web-file/md5","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":60,"frontMatter":{"sidebar_position":60},"sidebar":"tutorialSidebar","previous":{"title":"Get Path Size (LCC.web_file.size)","permalink":"/docs/en/XXTLanControl.lua/web-file/size"},"next":{"title":"Calculate File SHA1 (LCC.web_file.sha1)","permalink":"/docs/en/XXTLanControl.lua/web-file/sha1"}}');var i=l(4848),r=l(8453);const s={sidebar_position:60},a="Calculate File MD5 (LCC.web_file.md5)",o={},c=[{value:"Signature",id:"signature",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Notes",id:"notes",level:2},{value:"Example",id:"example",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,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"calculate-file-md5-lccweb_filemd5",children:"Calculate File MD5 (LCC.web_file.md5)"})}),"\n",(0,i.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"hash, err = LCC.web_file.md5(path, timeout?)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["path",(0,i.jsx)(n.br,{}),"\n","String. File to hash."]}),"\n",(0,i.jsxs)(n.li,{children:["timeout",(0,i.jsx)(n.br,{}),"\n","Number, optional. Request timeout in seconds, default ",(0,i.jsx)(n.code,{children:"60"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["hash",(0,i.jsx)(n.br,{}),"\n","String. 32-character hexadecimal MD5 digest; ",(0,i.jsx)(n.code,{children:"nil"})," on failure."]}),"\n",(0,i.jsxs)(n.li,{children:["err",(0,i.jsx)(n.br,{}),"\n","String or ",(0,i.jsx)(n.code,{children:"nil"}),". Error description when the call fails."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:["Computes the file's MD5 digest on the controller.",(0,i.jsx)(n.br,{}),"\n","Applies to files only; returns ",(0,i.jsx)(n.code,{children:"nil"})," when the path is missing or a directory."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local md5, err = LCC.web_file.md5("/scripts/main.lua")\nif md5 then\n    print("MD5=" .. md5)\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,l)=>{l.d(n,{R:()=>s,x:()=>a});var t=l(6540);const i={},r=t.createContext(i);function s(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]);