Advertisement
Guest User

hash

a guest
Aug 30th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. function hash(msg,salt,bool)
  2.   if not bool then
  3.     for i = 1, 10 do
  4.       msg = hash(msg,salt or "",true)
  5.     end
  6.   end
  7.   local num = ""
  8.   local salt = salt ~= nil and salt..msg or msg
  9.   for i = 1, #salt do
  10.     local let = salt:sub(i,i):byte()
  11.     num = let <= 9  and num.."99"..let or let<=99 and num.."9"..let or num..let
  12.   end
  13.   math.randomseed(tonumber(num))
  14.   local hashed = ""
  15.   for i = 1, 250 do
  16.     hashed = hashed..string.char(math.random(32,127))
  17.   end
  18.   return hashed
  19. end
  20.  
  21. print(hash("hi","salt"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement