<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.wikisphere.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AContactManager%2FBase64</id>
	<title>Module:ContactManager/Base64 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.wikisphere.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AContactManager%2FBase64"/>
	<link rel="alternate" type="text/html" href="https://www.wikisphere.org/w/index.php?title=Module:ContactManager/Base64&amp;action=history"/>
	<updated>2026-05-02T11:04:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.wikisphere.org/w/index.php?title=Module:ContactManager/Base64&amp;diff=149655&amp;oldid=prev</id>
		<title>Maintenance script at 10:52, 19 October 2025</title>
		<link rel="alternate" type="text/html" href="https://www.wikisphere.org/w/index.php?title=Module:ContactManager/Base64&amp;diff=149655&amp;oldid=prev"/>
		<updated>2025-10-19T10:52:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:52, 19 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki_wikisphere:diff:1.41:old-149397:rev-149655 --&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>https://www.wikisphere.org/w/index.php?title=Module:ContactManager/Base64&amp;diff=149397&amp;oldid=prev</id>
		<title>Maintenance script at 07:48, 1 September 2025</title>
		<link rel="alternate" type="text/html" href="https://www.wikisphere.org/w/index.php?title=Module:ContactManager/Base64&amp;diff=149397&amp;oldid=prev"/>
		<updated>2025-09-01T07:48:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
&lt;br /&gt;
 base64 -- v1.5.3 public domain Lua base64 encoder/decoder&lt;br /&gt;
 no warranty implied; use at your own risk&lt;br /&gt;
&lt;br /&gt;
 Needs bit32.extract function. If not present it&amp;#039;s implemented using BitOp&lt;br /&gt;
 or Lua 5.3 native bit operators. For Lua 5.1 fallbacks to pure Lua&lt;br /&gt;
 implementation inspired by Rici Lake&amp;#039;s post:&lt;br /&gt;
   http://ricilake.blogspot.co.uk/2007/10/iterating-bits-in-lua.html&lt;br /&gt;
&lt;br /&gt;
 author: Ilya Kolbin (iskolbin@gmail.com)&lt;br /&gt;
 url: github.com/iskolbin/lbase64&lt;br /&gt;
&lt;br /&gt;
 COMPATIBILITY&lt;br /&gt;
&lt;br /&gt;
 Lua 5.1+, LuaJIT&lt;br /&gt;
&lt;br /&gt;
 LICENSE&lt;br /&gt;
&lt;br /&gt;
 See end of file for license information.&lt;br /&gt;
&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local base64 = {}&lt;br /&gt;
&lt;br /&gt;
local extract = _G.bit32 and _G.bit32.extract -- Lua 5.2/Lua 5.3 in compatibility mode&lt;br /&gt;
if not extract then&lt;br /&gt;
	if _G.bit then -- LuaJIT&lt;br /&gt;
		local shl, shr, band = _G.bit.lshift, _G.bit.rshift, _G.bit.band&lt;br /&gt;
		extract = function( v, from, width )&lt;br /&gt;
			return band( shr( v, from ), shl( 1, width ) - 1 )&lt;br /&gt;
		end&lt;br /&gt;
	elseif _G._VERSION == &amp;quot;Lua 5.1&amp;quot; then&lt;br /&gt;
		extract = function( v, from, width )&lt;br /&gt;
			local w = 0&lt;br /&gt;
			local flag = 2^from&lt;br /&gt;
			for i = 0, width-1 do&lt;br /&gt;
				local flag2 = flag + flag&lt;br /&gt;
				if v % flag2 &amp;gt;= flag then&lt;br /&gt;
					w = w + 2^i&lt;br /&gt;
				end&lt;br /&gt;
				flag = flag2&lt;br /&gt;
			end&lt;br /&gt;
			return w&lt;br /&gt;
		end&lt;br /&gt;
	else -- Lua 5.3+&lt;br /&gt;
		extract = load[[return function( v, from, width )&lt;br /&gt;
			return ( v &amp;gt;&amp;gt; from ) &amp;amp; ((1 &amp;lt;&amp;lt; width) - 1)&lt;br /&gt;
		end]]()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function base64.makeencoder( s62, s63, spad )&lt;br /&gt;
	local encoder = {}&lt;br /&gt;
	for b64code, char in pairs{[0]=&amp;#039;A&amp;#039;,&amp;#039;B&amp;#039;,&amp;#039;C&amp;#039;,&amp;#039;D&amp;#039;,&amp;#039;E&amp;#039;,&amp;#039;F&amp;#039;,&amp;#039;G&amp;#039;,&amp;#039;H&amp;#039;,&amp;#039;I&amp;#039;,&amp;#039;J&amp;#039;,&lt;br /&gt;
		&amp;#039;K&amp;#039;,&amp;#039;L&amp;#039;,&amp;#039;M&amp;#039;,&amp;#039;N&amp;#039;,&amp;#039;O&amp;#039;,&amp;#039;P&amp;#039;,&amp;#039;Q&amp;#039;,&amp;#039;R&amp;#039;,&amp;#039;S&amp;#039;,&amp;#039;T&amp;#039;,&amp;#039;U&amp;#039;,&amp;#039;V&amp;#039;,&amp;#039;W&amp;#039;,&amp;#039;X&amp;#039;,&amp;#039;Y&amp;#039;,&lt;br /&gt;
		&amp;#039;Z&amp;#039;,&amp;#039;a&amp;#039;,&amp;#039;b&amp;#039;,&amp;#039;c&amp;#039;,&amp;#039;d&amp;#039;,&amp;#039;e&amp;#039;,&amp;#039;f&amp;#039;,&amp;#039;g&amp;#039;,&amp;#039;h&amp;#039;,&amp;#039;i&amp;#039;,&amp;#039;j&amp;#039;,&amp;#039;k&amp;#039;,&amp;#039;l&amp;#039;,&amp;#039;m&amp;#039;,&amp;#039;n&amp;#039;,&lt;br /&gt;
		&amp;#039;o&amp;#039;,&amp;#039;p&amp;#039;,&amp;#039;q&amp;#039;,&amp;#039;r&amp;#039;,&amp;#039;s&amp;#039;,&amp;#039;t&amp;#039;,&amp;#039;u&amp;#039;,&amp;#039;v&amp;#039;,&amp;#039;w&amp;#039;,&amp;#039;x&amp;#039;,&amp;#039;y&amp;#039;,&amp;#039;z&amp;#039;,&amp;#039;0&amp;#039;,&amp;#039;1&amp;#039;,&amp;#039;2&amp;#039;,&lt;br /&gt;
		&amp;#039;3&amp;#039;,&amp;#039;4&amp;#039;,&amp;#039;5&amp;#039;,&amp;#039;6&amp;#039;,&amp;#039;7&amp;#039;,&amp;#039;8&amp;#039;,&amp;#039;9&amp;#039;,s62 or &amp;#039;+&amp;#039;,s63 or&amp;#039;/&amp;#039;,spad or&amp;#039;=&amp;#039;} do&lt;br /&gt;
		encoder[b64code] = char:byte()&lt;br /&gt;
	end&lt;br /&gt;
	return encoder&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function base64.makedecoder( s62, s63, spad )&lt;br /&gt;
	local decoder = {}&lt;br /&gt;
	for b64code, charcode in pairs( base64.makeencoder( s62, s63, spad )) do&lt;br /&gt;
		decoder[charcode] = b64code&lt;br /&gt;
	end&lt;br /&gt;
	return decoder&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local DEFAULT_ENCODER = base64.makeencoder()&lt;br /&gt;
local DEFAULT_DECODER = base64.makedecoder()&lt;br /&gt;
&lt;br /&gt;
local char, concat = string.char, table.concat&lt;br /&gt;
&lt;br /&gt;
function base64.encode( str, encoder, usecaching )&lt;br /&gt;
	encoder = encoder or DEFAULT_ENCODER&lt;br /&gt;
	local t, k, n = {}, 1, #str&lt;br /&gt;
	local lastn = n % 3&lt;br /&gt;
	local cache = {}&lt;br /&gt;
	for i = 1, n-lastn, 3 do&lt;br /&gt;
		local a, b, c = str:byte( i, i+2 )&lt;br /&gt;
		local v = a*0x10000 + b*0x100 + c&lt;br /&gt;
		local s&lt;br /&gt;
		if usecaching then&lt;br /&gt;
			s = cache[v]&lt;br /&gt;
			if not s then&lt;br /&gt;
				s = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[extract(v,0,6)])&lt;br /&gt;
				cache[v] = s&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			s = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[extract(v,0,6)])&lt;br /&gt;
		end&lt;br /&gt;
		t[k] = s&lt;br /&gt;
		k = k + 1&lt;br /&gt;
	end&lt;br /&gt;
	if lastn == 2 then&lt;br /&gt;
		local a, b = str:byte( n-1, n )&lt;br /&gt;
		local v = a*0x10000 + b*0x100&lt;br /&gt;
		t[k] = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[64])&lt;br /&gt;
	elseif lastn == 1 then&lt;br /&gt;
		local v = str:byte( n )*0x10000&lt;br /&gt;
		t[k] = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[64], encoder[64])&lt;br /&gt;
	end&lt;br /&gt;
	return concat( t )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function base64.decode( b64, decoder, usecaching )&lt;br /&gt;
	decoder = decoder or DEFAULT_DECODER&lt;br /&gt;
	local pattern = &amp;#039;[^%w%+%/%=]&amp;#039;&lt;br /&gt;
	if decoder then&lt;br /&gt;
		local s62, s63&lt;br /&gt;
		for charcode, b64code in pairs( decoder ) do&lt;br /&gt;
			if b64code == 62 then s62 = charcode&lt;br /&gt;
			elseif b64code == 63 then s63 = charcode&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		pattern = (&amp;#039;[^%%w%%%s%%%s%%=]&amp;#039;):format( char(s62), char(s63) )&lt;br /&gt;
	end&lt;br /&gt;
	b64 = b64:gsub( pattern, &amp;#039;&amp;#039; )&lt;br /&gt;
	local cache = usecaching and {}&lt;br /&gt;
	local t, k = {}, 1&lt;br /&gt;
	local n = #b64&lt;br /&gt;
	local padding = b64:sub(-2) == &amp;#039;==&amp;#039; and 2 or b64:sub(-1) == &amp;#039;=&amp;#039; and 1 or 0&lt;br /&gt;
	for i = 1, padding &amp;gt; 0 and n-4 or n, 4 do&lt;br /&gt;
		local a, b, c, d = b64:byte( i, i+3 )&lt;br /&gt;
		local s&lt;br /&gt;
		if usecaching then&lt;br /&gt;
			local v0 = a*0x1000000 + b*0x10000 + c*0x100 + d&lt;br /&gt;
			s = cache[v0]&lt;br /&gt;
			if not s then&lt;br /&gt;
				local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 + decoder[d]&lt;br /&gt;
				s = char( extract(v,16,8), extract(v,8,8), extract(v,0,8))&lt;br /&gt;
				cache[v0] = s&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 + decoder[d]&lt;br /&gt;
			s = char( extract(v,16,8), extract(v,8,8), extract(v,0,8))&lt;br /&gt;
		end&lt;br /&gt;
		t[k] = s&lt;br /&gt;
		k = k + 1&lt;br /&gt;
	end&lt;br /&gt;
	if padding == 1 then&lt;br /&gt;
		local a, b, c = b64:byte( n-3, n-1 )&lt;br /&gt;
		local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40&lt;br /&gt;
		t[k] = char( extract(v,16,8), extract(v,8,8))&lt;br /&gt;
	elseif padding == 2 then&lt;br /&gt;
		local a, b = b64:byte( n-3, n-2 )&lt;br /&gt;
		local v = decoder[a]*0x40000 + decoder[b]*0x1000&lt;br /&gt;
		t[k] = char( extract(v,16,8))&lt;br /&gt;
	end&lt;br /&gt;
	return concat( t )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return base64&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------&lt;br /&gt;
This software is available under 2 licenses -- choose whichever you prefer.&lt;br /&gt;
------------------------------------------------------------------------------&lt;br /&gt;
ALTERNATIVE A - MIT License&lt;br /&gt;
Copyright (c) 2018 Ilya Kolbin&lt;br /&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy of&lt;br /&gt;
this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal in&lt;br /&gt;
the Software without restriction, including without limitation the rights to&lt;br /&gt;
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies&lt;br /&gt;
of the Software, and to permit persons to whom the Software is furnished to do&lt;br /&gt;
so, subject to the following conditions:&lt;br /&gt;
The above copyright notice and this permission notice shall be included in all&lt;br /&gt;
copies or substantial portions of the Software.&lt;br /&gt;
THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&lt;br /&gt;
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&lt;br /&gt;
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&lt;br /&gt;
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&lt;br /&gt;
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&lt;br /&gt;
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE&lt;br /&gt;
SOFTWARE.&lt;br /&gt;
------------------------------------------------------------------------------&lt;br /&gt;
ALTERNATIVE B - Public Domain (www.unlicense.org)&lt;br /&gt;
This is free and unencumbered software released into the public domain.&lt;br /&gt;
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this&lt;br /&gt;
software, either in source code form or as a compiled binary, for any purpose,&lt;br /&gt;
commercial or non-commercial, and by any means.&lt;br /&gt;
In jurisdictions that recognize copyright laws, the author or authors of this&lt;br /&gt;
software dedicate any and all copyright interest in the software to the public&lt;br /&gt;
domain. We make this dedication for the benefit of the public at large and to&lt;br /&gt;
the detriment of our heirs and successors. We intend this dedication to be an&lt;br /&gt;
overt act of relinquishment in perpetuity of all present and future rights to&lt;br /&gt;
this software under copyright law.&lt;br /&gt;
THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&lt;br /&gt;
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&lt;br /&gt;
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&lt;br /&gt;
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN&lt;br /&gt;
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION&lt;br /&gt;
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>