Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TextBin(ch)
- ch = string.byte(ch)
- r = ""
- local function chn(n)
- if ch >= n then
- ch = ch-n
- r = r..1
- else
- r = r..0
- end
- end
- chn(128) chn(64) chn(32) chn(16)
- chn(8) chn(4) chn(2) chn(1)
- chn = nil
- return r
- end
- function BinText(n)
- r = string.char(tonumber(n,2))
- return r
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement