Advertisement
LocalDuds

Untitled

Apr 21st, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. characters = {
  2. -- CAPS
  3. "A",
  4. "B",
  5. "C",
  6. "D",
  7. "E",
  8. "F",
  9. "G",
  10. "H",
  11. "I",
  12. "J",
  13. "K",
  14. "L",
  15. "M",
  16. "N",
  17. "O",
  18. "P",
  19. "Q",
  20. "R",
  21. "S",
  22. "T",
  23. "U",
  24. "V",
  25. "W",
  26. "X",
  27. "Y",
  28. "Z",
  29.  
  30. -- LOWER
  31. "a",
  32. "b",
  33. "c",
  34. "d",
  35. "e",
  36. "f",
  37. "g",
  38. "h",
  39. "i",
  40. "j",
  41. "k",
  42. "l",
  43. "m",
  44. "n",
  45. "o",
  46. "p",
  47. "q",
  48. "r",
  49. "s",
  50. "t",
  51. "u",
  52. "v",
  53. "w",
  54. "x",
  55. "y",
  56. "z",
  57.  
  58. "1",
  59. "2",
  60. "3",
  61. "4",
  62. "5",
  63. "6",
  64. "7",
  65. "8",
  66. "9",
  67. "0",
  68. "`",
  69. "~",
  70. "!",
  71. "@",
  72. "#",
  73. "$",
  74. "%",
  75. "^",
  76. "&",
  77. "*",
  78. "(",
  79. ")",
  80. "-",
  81. "=",
  82. "_",
  83. "+" ,
  84. " ",
  85. "[",
  86. "{",
  87. "]",
  88. "}",
  89. "\\",
  90. "|",
  91. "'",
  92. "\"",
  93. ";",
  94. ":",
  95. ",",
  96. "<",
  97. ".",
  98. ">",
  99. "/",
  100. "?",
  101. " ",
  102. "\n"
  103. }
  104.  
  105. function Encode(str, multiplier)
  106. String_Characters = {}
  107. for i=1,str:len() do
  108. table.insert(String_Characters, str:sub(i,i))
  109. end
  110.  
  111. return_chars = ""
  112.  
  113. for i,v in pairs(String_Characters) do
  114. for p,m in pairs(characters) do
  115. if (v == m) then
  116. local num = p * multiplier
  117. return_chars = return_chars..tostring(num).."/"
  118. end
  119. end
  120. end
  121.  
  122. return return_chars
  123. end
  124.  
  125. function Decode(str, multiplier)
  126.  
  127. local Numerical_Characters = {}
  128. for num in string.gmatch(str, '([^/|]+)') do
  129. table.insert(Numerical_Characters, num)
  130. end
  131.  
  132. local return_chars = ""
  133.  
  134. for p,m in pairs(Numerical_Characters) do
  135. local a = tonumber(m/multiplier)
  136. for b in string.gmatch(tostring(a), "[^%.]+") do
  137. if (b ~= "9876") then
  138. return_chars = return_chars..characters[tonumber(b)]
  139. end
  140. end
  141. end
  142.  
  143. return return_chars
  144. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement