sethxi

Untitled

Apr 13th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function hash(str)
  2. local s = 0
  3. local p = ""
  4.  
  5. for c in str:gmatch(".") do
  6. s = s + string.byte(c)
  7. end
  8.  
  9. s = bit.bxor(65432895, s)
  10.  
  11. while s > 0 do
  12. p = p .. string.char(s % 94 + 33)
  13. s = bit.brshift(s, 1)
  14. end
  15.  
  16. return string.sub(p, 1, p:len() - 1)
  17. end
  18.  
  19. local toHash = read("*")
  20.  
  21. local f = fs.open(".hash", "w")
  22. f.write(hash(toHash))
  23. f.close()
  24.  
  25. shell.run("pastebin", "put", ".hash")
  26. shell.run("rm", ".hash")
Advertisement
Add Comment
Please, Sign In to add comment