| View previous topic :: View next topic |
| Author |
Message |
door02 Newbie cheater
Reputation: 0
Joined: 28 Aug 2020 Posts: 20
|
Posted: Tue Oct 06, 2020 11:37 am Post subject: How to use |
|
|
How to use this?
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <[email protected]>
-- licensed under the terms of the LGPL2
-- character table string
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-- encoding
function enc(data)
return ((data:gsub('.', function(x)
local r,b='',x:byte()
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
return r;
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
if (#x < 6) then return '' end
local c=0
for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
return b:sub(c+1,c+1)
end)..({ '', '==', '=' })[#data%3+1])
end
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3344
|
Posted: Tue Oct 06, 2020 11:54 am Post subject: |
|
|
| Pass the data and expect a string in return?
|
|
| Back to top |
|
 |
door02 Newbie cheater
Reputation: 0
Joined: 28 Aug 2020 Posts: 20
|
Posted: Tue Oct 06, 2020 12:03 pm Post subject: |
|
|
| how please give me
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Oct 06, 2020 3:31 pm Post subject: |
|
|
Take the time to actually learn what you're doing and not just copy-paste code you find on the internet. The code you pasted is pretty straight forward once you understand Lua syntax, even if you're a beginner.
_________________
- Retired. |
|
| Back to top |
|
 |
|