Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Hex = {}
- local ABCDEF = {"A","B","C","D","E","F"}
- for i = 0,9 do
- table.insert(Hex,tostring(i))
- end
- for k,v in pairs(ABCDEF) do table.insert(Hex, v) end
- for i = 0,9 do
- table.insert(Hex,tostring("1"..i))
- end
- for i = 1,6 do
- table.insert(Hex,tostring("1"..ABCDEF[i]))
- end
- for i = 0,9 do
- table.insert(Hex,tostring("2"..i))
- end
- for i = 1,6 do
- table.insert(Hex,tostring("2"..ABCDEF[i]))
- end
- for i = 0,9 do
- table.insert(Hex,tostring("3"..i))
- end
- for i = 1,6 do
- table.insert(Hex,tostring("3"..ABCDEF[i]))
- end
- for i = 0,9 do
- table.insert(Hex,tostring("4"..i))
- end
- for i = 1,6 do
- table.insert(Hex,tostring("4"..ABCDEF[i]))
- end
- for i = 0,9 do
- table.insert(Hex,tostring("5"..i))
- end
- for i = 1,6 do
- table.insert(Hex,tostring("5"..ABCDEF[i]))
- end
- for i = 0,9 do
- table.insert(Hex,tostring("6"..i))
- end
- for i = 1,6 do
- table.insert(Hex,tostring("6"..ABCDEF[i]))
- end
- for i = 0,9 do
- table.insert(Hex,tostring("7"..i))
- end
- for i = 1,6 do
- table.insert(Hex,tostring("7"..ABCDEF[i]))
- end
- function CompileHex(amt)
- local s = s or ""
- for i = 1,amt do
- rnd = table.Random(Hex)
- s = s .. "0x" .. rnd.. ","
- end
- return string.sub(s,1,-2)
- end
- function DecompileHex(str)
- local e = string.Explode(",",str)
- local loco = {}
- for i = 1, #e do
- local dhe = string.gsub(e[i],"0x","")
- table.insert(loco, dhe)
- end
- local se = se or ""
- for k,v in pairs(loco) do
- se = se .. string.char(string.byte(v))
- end
- return se
- end
- local nhex = CompileHex(40)
- print(DecompileHex(nhex))
- print(nhex)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement