Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return {
- encryptCertificate = function(cert)
- local crt={A=50,B=51,C=52,D=53,E=54,F=55,G=56,H=57,I=58,J=59,K=60,L=61,M=62,N=63,O=64,P=65,Q=66,R=67,S=68,T=69,U=70,V=71,W=72,X=73,Y=74,Z=75}
- local final = ""
- for i = 1, cert:len() do
- local k = cert:sub(i,i)
- if not tonumber(k) then
- final = final .. crt[string.upper(cert:sub(i,i))]
- else
- final = final .. "0" .. tostring(k)
- end
- end
- return final
- end,
- decryptCertificate = function(cert)
- local crt={[50]="A",[51]="B",[52]="C",[53]="D",[54]="E",[55]="F",[56]="G",[57]="H",[58]="I",[59]="J",[60]="K",[61]="L",[62]="M",[63]="N",[64]="O",[65]="P",[66]="Q",[67]="R",[68]="S",[69]="T",[70]="U",[71]="V",[72]="W",[73]="X",[74]="Y",[75]="Z"}
- local final = ""
- if cert:len() % 2 > 0 then return final end
- for i = 1, cert:len(), 2 do
- local k = tonumber(i)
- if crt[k] then
- final = final .. tostring(crt[k])
- else
- final = final .. tostring(k:sub(2,2))
- end
- end
- return final
- end}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement