Skip to content

Instantly share code, notes, and snippets.

mengyun yunyyyun

  • hangzhou
Block or report user

Report or block yunyyyun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yunyyyun / Base64.lua
Last active Aug 10, 2017
Base64 encode/decode
View Base64.lua
function base64_encode(data)
local base64Table='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
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
yunyyyun / table2string
Created May 27, 2017
View table2string
table.tostring = function(t)
if t==nil then
return "error,print table is nil!"
local assign={}
local function ser_table(tbl,parent)
local tmp={}
for k,v in pairs(tbl) do
local key= type(k)=="number" and "["..k.."]" or "[".. string.format("%q", k) .."]"
if type(v)=="table" then
yunyyyun / HumpNaming.lua
Created May 27, 2017
View HumpNaming.lua
local hash = {};
hash = {
[""] = "Zhong";
[""] = "Guo";
[""] = "Gu";
[""] = "Piao";
[""] = "Ming";
[""] = "Cheng";
yunyyyun / hash.lua
Last active Aug 23, 2017
View hash.lua
g_HashTable = 0
function createHashTable()
local tb = {};
local _insert = function(k,v)
if k==0 then
for i = k,k+999,1 do
if i>1000 then
You can’t perform that action at this time.