hi i maked this functions
function ToBynary(str,seed)
seed = seed or 1
local abc = {string.byte(str,1,#str)}
table.foreach(abc,function(i,v)
abc[i] = v*seed
end)
return tonumber(table.concat(abc,"0"))
end
function FromBinary(byn,seed)
seed = seed or 1
local r = ""
table.foreach(string.split(byn,"0"),function(i,v)
r ..= string.char(v/seed)
end)
return r
end
that functions converts strings to number but not how tonumber()
this convert literally string to number
example:
local s = "abc" -- the original string
local b = ToBynary(s) -- returns binary string
local rs = FromBinary(b) -- returns the string unbynary
print(s,b,rs) -- prints (s: "abc"), (b: 97098099), (rs: "abc")
the seed is for create unique code